Table already exists (#1050) error (1 Viewer)

xlabuchi

New member
Local time
Today, 07:41
Joined
Jan 11, 2014
Messages
1
Hello,
I want export my table from access to mysql by button click.

Here my code:

DoCmd.TransferDatabase acExport, "ODBC Database", _
"ODBC;DSN=bw base to mysql BannyworksDB;UID=###;PWD=###;LANGUAGE=us_english;" _
& "DATABASE=BannyworksDB", acTable, "bazaT", "bazaT"

It is fine work, but if I click button again shortly it put out error:
Table already exists (#1050)

Furthermore I set in ODBC driver settings Ininitial Statement: DROP TABLE IF EXISTS `bazaT`;


Any help?
Please
 

jdraw

Super Moderator
Staff member
Local time
Today, 10:41
Joined
Jan 23, 2006
Messages
15,378
It would appear that your
Furthermore I set in ODBC driver settings Ininitial Statement: DROP TABLE IF EXISTS `bazaT`;
is not working.
Can you test it somehow?
 

haustein

New member
Local time
Today, 07:41
Joined
Jun 21, 2019
Messages
3
I have the same problem - what can i do

or is it possible to drop the mysql tab over vba access
 

isladogs

MVP / VIP
Local time
Today, 15:41
Joined
Jan 14, 2017
Messages
18,213
I can't answer questions specific to MySQL as I don't use it.
However, rather than drop the table then recreate it, by not link the MySQL table in Access, then empty it and repopulate it using delete and append queries.

Welcome to AWF as well. In general you would do better to start your own thread rather than piggy back onto one that is 5 years old
 

haustein

New member
Local time
Today, 07:41
Joined
Jun 21, 2019
Messages
3
no idea what you meant by that

my main prob is that i send by odbc an table to my webserver it works fine - if i do it once again than i get the failure - table already exists -

Code:
DoCmd.RunSavedImportExport "Abfrage1"

in the odbc settings i already i type in by initial statemant: DROP TABLE IF EXISTS `Reservierungen Abfrage2`; - but it does not work - if i wait i.e. one day than it works
 

isladogs

MVP / VIP
Local time
Today, 15:41
Joined
Jan 14, 2017
Messages
18,213
no idea what you meant by that

my main prob is that i send by odbc an table to my webserver it works fine - if i do it once again than i get the failure - table already exists -

Code:
DoCmd.RunSavedImportExport "Abfrage1"

in the odbc settings i already i type in by initial statemant: DROP TABLE IF EXISTS `Reservierungen Abfrage2`; - but it does not work - if i wait i.e. one day than it works

Sorry but you've no idea about which part of my answer?
And you still didn't say which error you get.
I gave you an alternative method which would mean you don't need to drop the table as you wouldn't keep creating a new copy each time
 
Last edited:

haustein

New member
Local time
Today, 07:41
Joined
Jun 21, 2019
Messages
3
i get this failure message
- table already exists -

can you send me an code example
 
Last edited:

Users who are viewing this thread

Top Bottom