Connect to database via VBA/DAO/ODBC

comp.databases.gupta (1995-2015)
Oliver

Connect to database via VBA/DAO/ODBC

Post by Oliver » 19 May 2005, 20:59

 Posted by:  Oliver <oli...@demus-online.de> 

Hello,
I am trying to connect to a database via VBA.
This is my connection string:

Set dbNorthwind = OpenDatabase("MYDB", False, False,
"ODBC;DSN=SQLBase;UID=sysadm;PWD=sysadm")

When I run this command, it comes up with a login window to the DB.

Can anybody tell me, on how I can avoid this window?

Thanks in advance,
Oliver

Oliver

Re: Connect to database via VBA/DAO/ODBC

Post by Oliver » 19 May 2005, 21:39

 Posted by:  Oliver <oli...@demus-online.de> 

OK, I fixed it on my own, this is the following solution:

Set dbNorthwind = OpenDatabase("MYDB", dbDriverNoPrompt, True,
"ODBC;DSN=MYDB;Database=MYDB;UID=sysadm;PWD=")

But now I have a problem, to get a recordset out of the Database. I run
the following statement:

Set rdShippers = dbNorthwind.OpenRecordset("Select * from myTable")

and I get a message back, that it can not find the table. But it is
there. Can somebody tell me, what I am doing wrong?

Thanks in advance,
Oliver

Return to “comp.databases.gupta”

Who is online

Users browsing this forum: [Ccbot] and 0 guests