dsn-less connection

J

Jason

Hi,

I'm having some problems with connecting to a sql server database.

I have a dsn-less connection solution by using an ado-connection. Although
the connection works, it seems that when i try to connect from the enduser's
pc, it cannot find the database. So i checked it by using a dsn and it then
found the database. Afterwards the ado-connection works, but i don't like
this solution.

Is there a way to pass the portnumber where the database listens on in the
ado-connection or should i set some more connection properties? Below is my
ado-connection.

ConnectionString = "DATA PROVIDER=SQLOLEDB;DATA
SOURCE=MyServer;DATABASE=MyDB;UID=username;PWD=password;"
 
D

Douglas J. Steele

AFAIK, you can't use OleDB with Access: you must use the ODBC provider.

Try

ConnectionString = "Driver={SQL Server};" & _
"Server=MyServer;" & _
"Database=myDB;" & _
"Uid=username;" & _
"Pwd=password"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top