Synchronisation

AmberO

Registered User.
Local time
Today, 16:33
Joined
May 9, 2002
Messages
27
Synchronisation using code

I am trying to synchronise replicas using the following code:

Dim dbs As DAO.Database

Set dbs = opendatabase("e:\design master\doug.mdb")

dbs.synchronize "k:\nydoug.mdb", dbrepimpexpchanges

MsgBox "sync completed"
dbs.Close

Set DB = CurrentDb
docmd.quit

It works fine for a test database, with only one change, but when I try it with my real database (with many changes) it does open both databases, but then it fails (before showing the message box) and says it can't find the database sync.mdb, which is the database I am running the code from.

Does anyone know what I have done wrong?

Thanks...
 
Last edited:
Are either of the databases secured with a password or user-level security? Have you tried trapping the error number or description to find out why either the db open or sync failed? There seem to be multiple possibilities here.

I've not used DAO for synchronization, but here's some code that works for me in JRO:

Dim rep As JRO.Replica
Set rep = New JRO.Replica
rep.ActiveConnection = "Data Source=C:\CBSDataBase\CBSDataHub.mdb; Password=mypassword; User ID=myID; Jet OLEDB:System database=C:\CBSDataBase\CBSSecurity.mdw"
rep.Synchronize "url_for_server_sync", jrSyncTypeImpExp, _
jrSyncModeInternet
Set rep = Nothing

Maybe there are some clues in there for your situation...

Matt
 
Last edited:
Thanks for your reply

Neither of the databases use passwords, or security of any kind.

Thanks for taking the time to list your code - it doesn't mean much to me, but you never know if it might help someone else!

I think I might just need a way to tell the code to wait while the synchronisation is going through before continuing...anyone else have any thoughts?
 

Users who are viewing this thread

Back
Top Bottom