467,910 Members | 1,588 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

ODBC connection using Access

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
  • viewed: 1179
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by DJJ | last post: by
4 posts views Thread by Andreas Lauffer | last post: by
4 posts views Thread by Dave | last post: by
1 post views Thread by paul_tomlin | last post: by
4 posts views Thread by Phil Latio | last post: by
3 posts views Thread by Greg Strong | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.