1

i am interested is it possible to create automated script to export single table from MS Access database in text file, and after that to have other script to automated import that text file in MySQL database, or maybe there is some better way to solve this kind of problem ? Also, server where is MS Access is running on windows , and MySQL service is working on Linux distribution CentOS. Thanks.

Erik A
  • 31,639
  • 12
  • 42
  • 67
MPetrovic
  • 123
  • 1
  • 5
  • 18

2 Answers2

0

You can use jet-tool to get SQL dump of .mdb file.

jet dump -f Your.mdb >dump.sql

Then import dump.sql by means of MySQL.

Dmitry Sokolov
  • 3,118
  • 1
  • 30
  • 35
0

I guess these two databases don't talk, or you should be able to export from MS Access and send the job straight to MY SQL. Is that right? Here is a script to do the export from Access to a text file.

Public Sub ExportTable()
   DoCmd.OutputTo acOutputTable, "tblCustomer", acFormatTXT, _
   "C:\BegVBA\Customer.txt"
End Sub

I haven't used MY SQL in a couple of years at least, and I don't have it setup on my machine now. Anyway, I think it would be something like this.

LOAD DATA INFILE '/tmp/mydata.txt' INTO TABLE PerformanceReport;

If that doesn't do the trick, you can easily Google it and figure it out yourself.

ASH
  • 20,759
  • 19
  • 87
  • 200