error 3146 (1 Viewer)

ellenr

Registered User.
Local time
Yesterday, 20:53
Joined
Apr 15, 2011
Messages
397
My BE mysql tables have been moved to a different server. Since it is a DNSless application for distribution, I have to remove them and setup the connections again. The code below is part of the function called by Autoexec. The code in blue is the only table of the twelve in the odbc location that will not connect. I get "error 3146." If and when it makes its connection, I will remove those lines. I have attached a screen capture of the setup of the table. If I setup a machine datasource, there is no problem connecting, so there is obviously no problem with the table. Any ideas why I cannot set up the connection for use with a dnsless connection?

Code:
Dim MyConnectionString As String
Dim MyODBCdb As Variant
Dim dbs As Database
   Set dbs = CurrentDb()
   
MyConnectionString = "ODBC;Driver={MySQL ODBC 5.1 Driver};" & _
    "Server=ipaddress;Database=" & "databaseName" & ";" & _
    "User=" & "username" & ";" & _
    "Password=" & "password" & ";" & _
    "Option=3;"
Set MyODBCdb = DBEngine(0).OpenDatabase("databaseName", dbDriverNoPrompt, True, MyConnectionString)
DoCmd.OpenQuery "openingPassThruQtokeepODBCopen", acViewNormal, acEdit

Dim tdfCurrent As Variant  'do the following for any new table

[COLOR="RoyalBlue"]Set tdfCurrent = CurrentDb.CreateTableDef("Checkbook")
tdfCurrent.Connect = MyConnectionString
tdfCurrent.SourceTableName = "Checkbook"
CurrentDb.TableDefs.Append tdfCurrent[/COLOR]
 

Attachments

  • Capture.PNG
    Capture.PNG
    52.9 KB · Views: 48

ellenr

Registered User.
Local time
Yesterday, 20:53
Joined
Apr 15, 2011
Messages
397
Answered my own question. My table was set up as CheckBook and I was trying to connect Checkbook. Didn't realize it was case sensitive!
 

Users who are viewing this thread

Top Bottom