Tuesday, January 30, 2018

ODBC connection string for an SQL Server database

Today I needed to get an ODBC application to connect to an SQL Server database. Getting the connection string right was a bit tricky. This is what I ended up with:
Driver=SQL Server;Pooling=false;Server=.\SQLEXPRESS;Data Source=.\SQLEXPRESS;Uid=myUsername;Pwd=thePassword

The important parts are the Driver and the Server. This only works for databases running on the same machine as the client program - I haven't yet worked out how to cross the network.

No comments:

Post a Comment