Open a database using DAO without using a DSN

  • Thread starter Thread starter Jack
  • Start date Start date
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
 
Not sure about the overall syntax, but try

Dim db as DAO.Database

and see if that helps.

Jake
 
Back
Top