By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

ODBC connection using Access

P: n/a
I am using Access 2K as a front end to MySQL running on a Linux server.
I am having trouble connectiong to the server. MySQL control centre connects
and I can connect using a DSN data source. But if I connect using the
following code

Dim constr As String
Dim tbl As DAO.TableDef

constr = "ODBC;DRIVER={MySQL ODBC 3.51 Driver};DESC=;USER=" & SQLServerUser
_
& ";DATABASE=" & SQLServerDatabase _
& ";SERVER=" & SQLServer _
& ";PASSWORD=" & SQLServerPassword _
& ";PORT=;OPTION=;STMT=;;TABLE=" & MYTABLENAME
tbl.Connect = constr
tbl.SourceTableName = MYTABLENAME
DoEvents
CurrentDb.TableDefs.Append tbl

I get a Cannot find installable ISAM error message when trying to append the
table. It appears that a connection is made but that I cannot access any of
the tables. I have tried using other connection methods and get the same
results.

If I change the above to
constr = "DSN=MYDSNCONNECTION;DESC=;USER=" & SQLServerUser _
& ";DATABASE=" & SQLServerDatabase _
& ";SERVER=" & SQLServer _
& ";PASSWORD=" & SQLServerPassword _
& ";PORT=;OPTION=;STMT=;;TABLE=" & MYTABLENAME

Where MYDSNCONNECTION is the DSN connection set up in the data sources, the
code works and the table is appended.
I would prefer to use the first method since I will not have to create the
DSN on every workstation.
Can anyone help me with this.
Jul 23 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.