Connecting to SQL server without DSN

  • Thread starter Thread starter gawime
  • Start date Start date
G

gawime

Guest
I have a form that asks for login parameters (Server, Database, Username, Password) and then creates a connection string.

The connection string looks something like

ODBC;
DRIVER={SQL Server}
;SERVER=<server>
;DATABASE=<database>
;UID=<uid>
;PWD=<pwd>;

I keep getting Error 3151 ODBC --- Connection to {SQL Server}<server} failed

What gives?

If I use a DSN in the connect string like

ODBC; DSN=<dsn>;
;UID=<uid>
;PWD=<pwd>;

it works just fine, but I would like to be able to connect to SQL server without using a DSN
 
you can use DSN-less connections with .MDB or .MDE
have a look at this for hints

my own DSN-less connections use something like this:
Code:
Global Const strConn = "ODBC;DRIVER={SQL Server};DATABASE=BlahBlahDB;SERVER=123.45.67.89;Network=DBMSSOCN;Address=123.45.67.89,1433;Trusted_Connection=Yes"
...which doesn't help you too much cos i'm using the network login for security.

izy
 

Users who are viewing this thread

Back
Top Bottom