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

What is the best way to synchronize data between MS Access and MySQL?(在 MS Access 和 MySQL 之间同步数据的最佳方法是什么?)
本文介绍了在 MS Access 和 MySQL 之间同步数据的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 机器上有一个访问数据库,我必须将其导入到 linux 网络服务器上的 mysql.此时access dabatbase表导出为文本文件,用ftp自动复制,然后加载到mysql中.

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.

有没有更好的方法可以做到这一点,也许使用 ODBC 连接或其他方式?

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

限制复制已经存在的信息的最佳方法是什么,即只传输在访问数据库中但尚未在 mysql 中的记录.

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.

access 数据库是由另一个程序处理的,如果我不必对其进行更改,甚至不必打开它,那将是最好的.不可能需要从访问数据库中导入更新的记录.mysql 数据库将是主要来源,一些记录将被删除或更改.我只想导入从未在mysql数据库中的记录,而不是恢复故意删除的记录.

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.

推荐答案

为什么不按照 Keltia 的建议通过 ODBC 链接表,然后使用一系列查询来添加丢失的记录并更新更改的记录.查询可以通过 VBA 运行.ADO 也可以很好地与 MySQL 和 Access 配合使用.

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.

关于 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

-- http://forum.lessthandot.com/viewtopic.php?f=95&t=3862

这篇关于在 MS Access 和 MySQL 之间同步数据的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)