I have the following connection string in a Excel VBA project:

oCon.ConnectionString = "Driver={SQL Native Client};Server=SQL;Database=D1; Trusted_Connection=yes;"

On my laptop this works perfectly. But when I try it out on another computer I get an error:

I get this error when oCon.Open on debugging:

Run-time error '-2147467259(80004005)':
Automation error
Unspecified error

On first time run i get the error:

Run-time error '-2147467259(80004005)':
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified

What is wrong?
(Posted it here since it is vb code)

5 Years
Discussion Span
Last Post by lcfjoertoft

Looks like the SQL Native Client is not installed on the other computer. Other questions to check into are:
1. Does the other computer have the SQL Native Client driver installed with a different name? This happens depending on if you are using SQL 2000, 2005 or 2008. Some possibilities are: "SQL Server"; "SQL Server Native Client 10.0". If so, correct it in your connection string.
2. Are the server name and database name correct? If not, correct it.
3. Is your local SQL Server configured to allow remote connections? If not, change the configuration to allow it.
4. Does the user logged in on the other computer have permissions to connect and to read the database? If not, grant the permissions.

Hope this helps!


Thanks bitbit. It wasn't installert. Didn't know it had to be, but Thanks to you, It's fixed.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.