access 同步 mysql数据库_在MS Access和MySQL之间同步数据的最佳方法是什么?

bd96500e110b49cbb3cd949968f18be7.png

I have an access database on a windows machine, which I must import into mysql on a linux webserver. At the moment the access dabatbase table is exported as a text file, automatically copied with ftp, and then loaded into mysql.

Is there a better way to do this, perhaps using an ODBC connection or something else?

What is the best way to limit copying information that is already present, ie to only transfer records that are in the access database but not yet in the mysql one.

The access database is handled by another program, and it would be best if I did not have to makes changes to it, or even open it. There is no possibility of needing to import updated records from the access database. The mysql database will be the main source, and some records will be deleted or changed. I only want to import records that were never in the mysql database, not restore the ones that were purposefully deleted.

解决方案

Why not link the tables through ODBC as suggested by Keltia, and then use a series of queries to add records that are missing and to update changed records. The queries can be run through VBA. ADO will also work well with MySQL and Access.

Some notes on code used in Access:

Set db = CurrentDb

strSQL = "Insert INTO [ODBC;DSN=DSNName;].NameOfMySQLTable " _

& "Select AnyField As NameOfMySQLField FROM AnyAccessTable;"

db.Execute strSQL, dbFailOnError

End Sub

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值