Replication Sync Button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to create a button on a form that synchronizes the master
database with a replicated access database?

Thanks in advance.
 
Is there any way to create a button on a form that synchronizes
the master database with a replicated access database?

Well, first off, if you're talking about the Design Master, you
shouldn't be using that for production editing. The DM is a special
replica and the only proper use for it is to make design changes. It
should be kept somewhere safe and synched only as often as necessary
to keep it from expiring (the default retention period is 1000
days).

Any two replicas can be synched from a command button. The level of
complexity of the task depends on your environment (whether all
replicas are local to the LAN or not) and how much error checking
you want (do you want to check for conflicts after the synch, etc.).

In a properly split application, you'll need to get the name of the
back end replica. This can be gotten from:

Mid(CurrentDB.TableDefs("LinkedTable").Connect, 11)

Assuming a direct synch using DAO (the easiest task), you'd have
code behind the command button something like this:

Dim dbLocal As DAO.Database
Dim strLocal As String

strLocal = Mid(CurrentDB.TableDefs("LinkedTable").Connect, 11)
Set dbLocal = DBEngine.OpenDatabase(strLocal)
dbLocal.Synchronize "Path/Filename of partner replica"

dbLocal.Close
Set dbLocal = Nothing

The hard part is supplying the name of the remote replica. In most
cases, I'd suggest that you'd be synching from known location to
known location, so it can be hardwired, or from a laptop to a
central server replica. In the latter case, you could hardwire the
path to the central hub that everyone synchs with and use the
Connect string to get the laptop's replica name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top