Reputation: 319
I'm trying to connect to SQL Server 2008
with ODBC
driver, I have searched around but didn't find much. Also, I tried the source at Using ODBC to connect to SQL SERVER 2008 but I received this message:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I'm using this connection string:
DRIVER={Sql Client};
SERVER=WIN-QNPAH3SE4CK\SQLSRV,1433;
DATABASE=dummy;
UID=sa;
PWD=sasasasa;
Trusted_Connection=no;
Can anyone help me?
Upvotes: 3
Views: 16496
Reputation: 2305
In your connection string replace the {SQL Client} with {SQL Server}
Edit: That's why it's always important to post the code...
You can't do this cast: (SQLWCHAR*)"DRIVER={SQL Server};SERVER=WIN-QNPAH3SE4CK\SQLSRV,1433;DATABASE=dummy;UID=sa;PWD=sasasasa;Trusted_Connection=no;"
Switch it to something like this: (SQLWCHAR*)TEXT("DRIVER={SQL Server};SERVER=WIN-QNPAH3SE4CK\SQLSRV,1433;DATABASE=dummy;UID=sa;PWD=sasasasa;Trusted_Connection=no;")
Upvotes: 5