MySQL Forums
Forum List  »  Connector/ODBC

OpenDatabase Method in VBA fails
Posted by: George Bamiedakis
Date: September 29, 2004 12:12PM

Hi to all of you,

I am trying to use in VBA (ESRI ArcGIS 8.3) the OpenDatabase method.

I have installed the ODBC driver MySQL 3.51 and created a DSN.
I have tested my DSN and it is connecting to the database without any problems.

Now I want to open a database connection within the VBA environment
and setup a recordset object using the following code:


Dim db as database, rs as recordset
Dim connString as String
conString = "ODBC;DSN=myDsnName;DATABASE=myDatabase;UID=root;PWD=mypasswd)
set db = OpenDatabase("", dbDriverNoPrompt, False, connString) ' <--- here the code fails

set rs = db.OpenRecordset("myTable", dbOpenDynaset)

Unfortunatelly the OpenDatabase method fails with the following error message:

"ODBC-- The connection to myDsnName has failed"

Does anybody know why this happens?
Any suggestion would be greatly appreciated.

Regards
George

Options: ReplyQuote


Subject
Written By
Posted
OpenDatabase Method in VBA fails
September 29, 2004 12:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.