Access Error when linking/exporting Data through MySQL ODBC connection

Access Error when linking/exporting Data through MySQL ODBC connection

am 22.04.2006 00:13:21 von Eric Lommatsch

------_=_NextPart_001_01C66590.CCFC4140
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,
=20
I have been fighting this issue for the better part of a day. If someone =
can
suggest a way to figure this out I would appreciate the help.
=20
At a client site they have begun the process migrating to a new Domain
server. At this site Microsoft access is used as a front end to MySQL. =
Today
I was trying to make sure that the linked tables in the access Database =
are
properly connected to the correct MySQL server, which is installed on =
the new
domain server.
=20
I have updated the ODBC connection that I am using to link to this =
database
so that it points the the new server and all of my other applications =
that
use the ODBC connection appear to work correctly. But, when I open up =
the
access database it is still linked to the database on the old server. My
first thought was to simply delete the links to the Old server and =
replace
them with links to the new server. When I do this Access comes up with =
an
error message saying that an error has occurred and asking me if I want =
to
restart Access.
=20
This appears to be happening on any computer that is located in this =
office.
I tried creating a new Access Database and same error is still =
occurring.
=20
I have tried creating a brand new MySQL Database with only one dummy =
table in
it and connecting to it from access and the results are no different.
=20
I exported Data from the MySQL database and transferred it to our office =
and
in our office I am having no problem in linking to MySQL from Access.
=20
I have even been able to write a small Access VBA Module that tested
connecting to the MySQL Database through the DSN and this worked.
=20
Is this a case where because the Migration has not yet been completed =
Access
is confused on how to link to the ODBC DSN? Or is there something else =
that I
have not yet thought of that I need to do to get this to work?
=20
The client site has version 4.0.13 of MySQL Installed with MySQL ODBC
connector version 3.51.06 and Access 2002. Up until the migration =
process was
started this seemed to work. =20
=20
Thank you
=20
Eric H. Lommatsch
Programmer
MICRONix, Inc.
2087 South Grant Street
Denver, CO 80210
Tel 303-777-8939
Fax 303-778-0378
=20
ericl@Micronix.com
=20

------_=_NextPart_001_01C66590.CCFC4140--

RE: Access Error when linking/exporting Data through MySQL ODBC connection

am 24.04.2006 11:18:27 von Al McNicoll

------=_NextPart_000_003C_01C66788.6D722C50
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi Eric,



When I've had this problem occasionally, I've found my best bet was to write
a Public Sub in a module that cycles through all tabledefs, checks their
Connect strings, replaces any previous DSN with the new one (or else just
sets the Connect string from scratch) and then terminates. Then
Compact/Repair. I can't give any logical reason why this should work, but it
has done for me in the past. A few other suggestions too:



a) Are you using ADODB recordsets? If so (though it sounds obvious) make
sure that wherever you specified the connection string for the ADODB
connection that they use, you've updated that to the new server

b) Are you using DAO recordsets? Make sure that
CurrentProject.ActiveConnection (might be CurrentDB. - can't remember) has
the up-to-date connection string.

c) As b) if you're using ADODB but opening your recordsets using the
DB/project's ActiveConnection

d) Have you tried the /decompile switch (undocumented)? If you've got
hard-coded connection strings, this may be worth a try. Sometimes, for
reasons best known to itself, Access doesn't correctly work out which code
has already been compiled, and which has not. In any case, VBA code in
Access can be in any one of 11 states of compilation! So loading your DB
with Start-> Run-> "c:\your_msoffice_path_here\msaccess.exe" /decompile
"c:\path_to_your_db\mydb.mdb" (quotes as I've put them there) and then go to
the VBA Editor and do Debug-> Compile, that might fix it.



Hope that helps - let me know if it does.



Al McNicoll

Integritec Ltd







-----Original Message-----
From: Eric Lommatsch [mailto:EricL@micronix.com]
Sent: 21 April 2006 23:13
To: myodbc@lists.mysql.com
Subject: Access Error when linking/exporting Data through MySQL ODBC
connection



Hello,



I have been fighting this issue for the better part of a day. If someone can

suggest a way to figure this out I would appreciate the help.



At a client site they have begun the process migrating to a new Domain

server. At this site Microsoft access is used as a front end to MySQL. Today

I was trying to make sure that the linked tables in the access Database are

properly connected to the correct MySQL server, which is installed on the
new

domain server.



I have updated the ODBC connection that I am using to link to this database

so that it points the the new server and all of my other applications that

use the ODBC connection appear to work correctly. But, when I open up the

access database it is still linked to the database on the old server. My

first thought was to simply delete the links to the Old server and replace

them with links to the new server. When I do this Access comes up with an

error message saying that an error has occurred and asking me if I want to

restart Access.



This appears to be happening on any computer that is located in this office.

I tried creating a new Access Database and same error is still occurring.



I have tried creating a brand new MySQL Database with only one dummy table
in

it and connecting to it from access and the results are no different.



I exported Data from the MySQL database and transferred it to our office and

in our office I am having no problem in linking to MySQL from Access.



I have even been able to write a small Access VBA Module that tested

connecting to the MySQL Database through the DSN and this worked.



Is this a case where because the Migration has not yet been completed Access

is confused on how to link to the ODBC DSN? Or is there something else that
I

have not yet thought of that I need to do to get this to work?



The client site has version 4.0.13 of MySQL Installed with MySQL ODBC

connector version 3.51.06 and Access 2002. Up until the migration process
was

started this seemed to work.



Thank you



Eric H. Lommatsch

Programmer

MICRONix, Inc.

2087 South Grant Street

Denver, CO 80210

Tel 303-777-8939

Fax 303-778-0378



ericl@Micronix.com




------=_NextPart_000_003C_01C66788.6D722C50--

RE: Access Error when linking/exporting Data through MySQL ODBC connection

am 24.04.2006 19:00:40 von Eric Lommatsch

------_=_NextPart_001_01C667C0.9DF63BD4
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

It appears when I try to do this that the tabledef are read only when I =
try
to update the connect string with the new information, this New =
information
is not being saved. =20
=20
Thank you
=20
Eric H. Lommatsch
Programmer
MICRONix, Inc.
2087 South Grant Street
Denver, CO 80210
Tel 303-777-8939
Fax 303-778-0378
=20
ericl@Micronix.com
=20

________________________________

From: Al McNicoll [mailto:al@integritec.co.uk]=20
Sent: Monday, April 24, 2006 3:18 AM
To: Eric Lommatsch
Cc: myodbc@lists.mysql.com
Subject: RE: Access Error when linking/exporting Data through MySQL ODBC
connection



Hi Eric,

=20

When I've had this problem occasionally, I've found my best bet was to =
write
a Public Sub in a module that cycles through all tabledefs, checks their
Connect strings, replaces any previous DSN with the new one (or else =
just
sets the Connect string from scratch) and then terminates. Then
Compact/Repair. I can't give any logical reason why this should work, =
but it
has done for me in the past. A few other suggestions too:

=20

a) Are you using ADODB recordsets? If so (though it sounds obvious) make =
sure
that wherever you specified the connection string for the ADODB =
connection
that they use, you've updated that to the new server

b) Are you using DAO recordsets? Make sure that
CurrentProject.ActiveConnection (might be CurrentDB. - can't remember) =
has
the up-to-date connection string.

c) As b) if you're using ADODB but opening your recordsets using the
DB/project's ActiveConnection

d) Have you tried the /decompile switch (undocumented)? If you've got
hard-coded connection strings, this may be worth a try. Sometimes, for
reasons best known to itself, Access doesn't correctly work out which =
code
has already been compiled, and which has not. In any case, VBA code in =
Access
can be in any one of 11 states of compilation! So loading your DB with
Start-> Run-> "c:\your_msoffice_path_here\msaccess.exe" /decompile
"c:\path_to_your_db\mydb.mdb" (quotes as I've put them there) and then =
go to
the VBA Editor and do Debug-> Compile, that might fix it.

=20

Hope that helps - let me know if it does.

=20

Al McNicoll

Integritec Ltd

=20

=20

=20

-----Original Message-----
From: Eric Lommatsch [mailto:EricL@micronix.com]=20
Sent: 21 April 2006 23:13
To: myodbc@lists.mysql.com
Subject: Access Error when linking/exporting Data through MySQL ODBC
connection

=20

Hello,

=20

I have been fighting this issue for the better part of a day. If someone =
can

suggest a way to figure this out I would appreciate the help.

=20

At a client site they have begun the process migrating to a new Domain

server. At this site Microsoft access is used as a front end to MySQL. =
Today

I was trying to make sure that the linked tables in the access Database =
are

properly connected to the correct MySQL server, which is installed on =
the new

domain server.

=20

I have updated the ODBC connection that I am using to link to this =
database

so that it points the the new server and all of my other applications =
that

use the ODBC connection appear to work correctly. But, when I open up =
the

access database it is still linked to the database on the old server. My

first thought was to simply delete the links to the Old server and =
replace

them with links to the new server. When I do this Access comes up with =
an

error message saying that an error has occurred and asking me if I want =
to

restart Access.

=20

This appears to be happening on any computer that is located in this =
office.

I tried creating a new Access Database and same error is still =
occurring.

=20

I have tried creating a brand new MySQL Database with only one dummy =
table in

it and connecting to it from access and the results are no different.

=20

I exported Data from the MySQL database and transferred it to our office =
and

in our office I am having no problem in linking to MySQL from Access.

=20

I have even been able to write a small Access VBA Module that tested

connecting to the MySQL Database through the DSN and this worked.

=20

Is this a case where because the Migration has not yet been completed =
Access

is confused on how to link to the ODBC DSN? Or is there something else =
that I

have not yet thought of that I need to do to get this to work?

=20

The client site has version 4.0.13 of MySQL Installed with MySQL ODBC

connector version 3.51.06 and Access 2002. Up until the migration =
process was

started this seemed to work. =20

=20

Thank you

=20

Eric H. Lommatsch

Programmer

MICRONix, Inc.

2087 South Grant Street

Denver, CO 80210

Tel 303-777-8939

Fax 303-778-0378

=20

ericl@Micronix.com

=20


------_=_NextPart_001_01C667C0.9DF63BD4--