I am trying to connect to SQL Server 2008 from Excel VBA using the connection string (ADODB.Connection
).
"Driver={SQL Native Client};Data Source=" & Range("Svr").Value & ";Database=" & Range("DB").Value & ";Trusted_Connection=yes"
When I try to open the connection I get this error
Error (-2147467259) Description - [Microsoft][ODBC Driver Manager] Data source name too long
Can some one please provide me a sample
Svr
andDB
named ranges in your workbook? – Widor