Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 179271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:22:40+00:00 2026-05-11T14:22:40+00:00

I am looking for a way to manage syncronization between an Access mdb file

  • 0

I am looking for a way to manage syncronization between an Access mdb file for an application, and a MySQL schema containing a copy of the same tables. This arose from the fact that the application doesn’t support MySQL as a backend, but I am looking for a way to utilize MySQL for other in-office applications using the data the first application generates.

Some givens:

1> We cannot abandon the first application, and it’s only compatible with Microsoft SQL Server as a backend server to house data.

2> We are not against using Microsoft SQL server, but the licensing cost is a big concern – as well as rewritting some other Access applications written to use linked tables and seperate mdb files.

3> The database server should be ‘PHP friendly’ for a future expansion project for an internal corporate intraweb.

4> No data needs to be, nor should be allowed to be, accessed from outside the corporate network.

I hope I am not being too obscure, but I don’t want to break confidences either – so I am trying to walk a pretty tight rope. If anyone can help, I’d greatly appreciate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T14:22:40+00:00Added an answer on May 11, 2026 at 2:22 pm

    Synchronizing two databases is very, very complicated if both databases need to be updatable. If one is a slave of the other, it’s not nearly as difficult. I have more than once programmed just this kind of synchronization using Access, once with an MDB on a web server that had to be synched with a local data MDB (to incorporate data edited on the website; no edits went back to the website, so one-way synch, but still the need to merge edits on the non-web side), as well as once programming a synch between MySQL on a website and Access in a master (MySQL) / slave (Access) relationship.

    On the website, you program a dump of data for each table to a text file. It’s helpful to have timestamp fields in the MySQL tables so that you know when records were created and updated. This allows you to select which records to dump since the last data dump (which makes the synchronization of data on the Access side much simpler).

    The way I programmed it was to then import the text files into staging tables that were indexed appropriately and linked to the front-end Access app. Once the data dumps are imported into the staging tables, you then have three tasks:

    1. find the new records and append them to the Access data store. This is easily done with an outer join.

    2. deal with the deletions. I’ll discuss this later, as it’s, well, complicated.

    3. deal with updated records. For this, I wrote DAO code that would write column-by-column SQL statements.

    Something like this:

    UPDATE LocalTable SET LocalTable.Field1 = DownloadTable.Field2, LocalTable.Updated = DownloadTable.Updated WHERE LocalTable.Field1 <> DownloadTable.Field2 

    Now, obviously, the WHERE clause has to be a bit more complicated than that (you have to deal with NULLs, and you have to use criteria formatted appropriately for the data types, i.e., with ” and ## for text and dates, respectively, and no delimiters for numeric data), but writing the code to do that is pretty easy.

    Skeleton code looks something like this:

      Dim db As DAO.Database   Dim rsFields As DAO.Recordset   Dim fld As DAO.Field   Dim strSQL As String    Set rsFields = db.OpenRecordset('SELECT TOP 1 Field1, Field2, Field3 FROM LocalTable;')   For Each fld in rsFields     [write your SQL statement and execute it]   Next fld   Set fld = Nothing   rsFields.Close   Set rsFields = Nothing   Set db = Nothing 

    Now, as I said, the complicated part is writing the WHERE clause for each SQL statement, but that’s pretty easy to figure out. Also, note that in your rsFields recordset (which is used only to walk through the fields you want to update) you want to include only the fields that are updatable, so you’d leave out the CREATED field and the PK field (and any other fields that you don’t want to update).

    Now, for the DELETES.

    You might think it’s a good idea to simply delete any record in the local table that’s not in the remote table. That works fine if it really is a slave database, but so often what is originally a slave ends up getting its own edits. So, in that case, you need to not delete records from the master MySQL database, and instead have a DELETE flag that marks records deleted. You could have different varieties of logic that could clean the deleted records out of the master database (e.g., if you’re using date stamps in the records, you could delete all records flagged DELETED with LastUpdated timestamp that is <= the last time you dumped the data; alternatively, you could have the Access app send a text file up to the server with a list of the records that have been successfully deleted from the Access data store). If there are edits in the Access data store, then you’ll need some logic for dealing with an edit there on a record that was deleted from the MySQL ‘master’ database.

    In summary:

    If you have a true master/slave relationship, it’s fairly trivial. If you really wanted to do it by brute force, you’d just dump the entirety of all the MySQL data tables to text files, delete all the records in your Access data store and import the text files.

    I would tend not to do that, as the first time you need to depart from the pure master/slave relationship, you’re hosed and have to rewrite everything from scratch.

    The outline I gave above will work very cleanly for master/slave, but will also work well if you have a few fields that are private to the ‘slave’ database, or data that exists in the slave and not in the master (which is the situation I was working with).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 112k
  • Answers 112k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer NSURLConnection (as part of the URL Loading System) will give… May 11, 2026 at 9:56 pm
  • Editorial Team
    Editorial Team added an answer looks like you probably landed on a bug there. It… May 11, 2026 at 9:56 pm
  • Editorial Team
    Editorial Team added an answer T = [L[i] for i in Idx] May 11, 2026 at 9:56 pm

Related Questions

I am new to Facebook application development and I am looking for a way
We currently have a whole suite of report designs that cover various parts of
I have a challenge I need some input on. I am currently recruiting programmers
Recently, I've been reading up on the IRC protocol (RFCs 1459, 2810-2813), and I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.