Open a database using DAO without using a DSN

J

Jack

Hello all,

Can someone tell me the syntax to use for opening a
database with DAO without having to use a DSN? So far,
when I try to do this, I get errors complaining about not
being able to find the database. Here is what I've been
trying to use:

Dim db As Database

Set db = OpenDatabase("MyServerName", dbDriverNoPrompt,
False, _
"ODBC; DRIVER=SQLServer; SERVER=MyServer;
DATABASE=MyDatabase; UID=MyUID; PWD=MyPassword;")


Thanks for any help/advice,

-Jack
 
J

Jake

Not sure about the overall syntax, but try

Dim db as DAO.Database

and see if that helps.

Jake
 

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