# VLOOKUP against SQL Server database - Help!



## SNGLIFE (Nov 28, 2007)

Simplified scenario:

I have column A and column B with multiple rows of variable data in the column A cells (i.e. account numbers).  I want to return a value to the cell in column B pulled from a single SQL Server table which depends upon the value in the column A cell (i.e. account names). 

It's essentially the same as a VLOOKUP against a SQL table rather than an Excel range.  VLOOKUP will not work, so I am looking for other solutions.

I am using Excel 2007.  I am aware of the SQL.REQUEST function as a clumsy but workable solution, but it is not supported in Excel 2007.

Anyone up to the challenge?  Thanks in advance!


----------



## Richard Schollar (Nov 29, 2007)

Hi & Welcome to the Board!

See here:

http://www.mrexcel.com/board2/viewtopic.php?p=1459805#1459805


----------



## SNGLIFE (Nov 29, 2007)

*Thanks!*

I'm not a VBA guy (one of these dayz...), but it looks pretty straightforward enough for me to be able to get it to work.  You wouldn't happen to have the connection string syntax for SQL Server 2005 in your back pocket, wouldja?  

Thanks again!


----------



## Richard Schollar (Nov 29, 2007)

I always go here when I need a connection string:

http://www.connectionstrings.com/?carrier=sqlserver2005


----------



## SNGLIFE (Nov 29, 2007)

Mahvelous!  Thanks!


----------

