doulostheou
Registered User.
- Local time
- Today, 04:37
- Joined
- Feb 8, 2002
- Messages
- 314
I am trying to automate a link to a MySQL table. I can create the link with no problem using the Wizard/DSN.. However, my VBA code to mimic this behavior is failing. The code is as follows:
When it gets to the final line where it should create the link, I get a window that pops up with Connector/ODBC 3.51.21 - Driver Connect in the heading that shows the configuration. I click Ok and the I get error 3151, ODBC-Connect Failed. Does anyone have any ideas where I am going wrong?
Code:
Dim td As TableDef
Set td = CurrentDb.CreateTableDef("lnkTest")
td.Connect = "ODBC;Driver={MySQL ODBC 3.51 Driver};Server=0.0.0.0;Database=db;UID=username;PWD=pass;Option=3;"
td.SourceTableName = "tblClaims"
CurrentDb.TableDefs.Append td
When it gets to the final line where it should create the link, I get a window that pops up with Connector/ODBC 3.51.21 - Driver Connect in the heading that shows the configuration. I click Ok and the I get error 3151, ODBC-Connect Failed. Does anyone have any ideas where I am going wrong?