Excel macro connect to database driver error
Posted on 2010-01-12
We have a macro made that has to connect to an sql server/database before proceeding.
But I think there's a driver issue, and I'm not sure what else I can try.
The macro spreadsheet worked before I did a sql management studio on my client PC and now when I run the macro I get an error:
"Unable to connect to the database. Please try again later".
This is the line I'm using:
Const cnct As String = "DRIVER=SQL Native Client;SERVER=SQL001\SQL001;UID=user;PWD=password;Database=sql_001;"
I know the database name and server and credentials are correct, because when I use "Provider=SQLOLEDB.1" in place of "DRIVER-SQL Native Client" I don't get the error and our spreadsheet can continue to run.
What else besides DRIVER or Provider can we use?