Greetings!
I am trying to open an ODBC connection using DAO.
In VB, the connections string "ODBC;dsn=mydsn;uid=xxx;pwd=yyy" works
just fine. But in DAO, the uid and pwd are ignored, and the driver opens
a login dialog.
How can I prevent this?
In the example below, the uid and pwd allow the database open to work, but
they
are not remembered, and the recordset open shows the login dialog. If I
don't
specify a uid/pwd in either the connect string or in the registry, then I
get TWO login
dialogs.
My code looks like:
pdbJS = new CDaoDatabase();
pdbJS->Open("", FALSE, FALSE,"ODBC;DSN=mydsn;UID=user;PWD=pw");
prsJS = new CDaoRecordset(pdbJS);
prsJS->Open(dbOpenDynaset, "SELECT * from PROFIL", dbReadOnly);
prsJS->MoveFirst();
I had assumed this was an ODBC driver problem, but it works perfectly in VB.
Thanks in advance!
Rich