PDA

View Full Version : Emergency: Synchronization Problem



Imdabaum
09-13-2006, 09:46 AM
Ok guys Much love to anyone who can help me with this one. I was assigned to modify a replicated Access mdb. So we have the synchronizationMaster.mdb and all the other little replicas.

I made a replica of the synchMaster.mdb Recovered the design master and made the changes. I then opened the synchMaster and synchronized the Program with the designMaster.mdb. This worked fine until the boss tried to synchronize his program with the synchmaster. He got all the tables, but his data was looking for something on my local computer.

I created a replica from the designMaster on the network in a folder: DesignMaster. Then deleted my local copy and made the network copy the design master. Then synchronized the synchMaster with the new Design Master. Now when the boss opens his application it just opens up Access (no mdb file just Access) Can I recover this? How do I set the replicas to continue to look for their corresponding data instead of shifting the target to my local directory.:banghead: :banghead: :banghead:

Ken Puls
09-13-2006, 11:08 AM
Hey there,

I'm not sure if anyone will/will not come along quickly enough to help you with this one. It's WAY over my head, I'll tell you that.

You may have better luck posting this thread at www.utteraccess.com (http://www.utteraccess.com). They're very Access focussed, and have a lot of traffic as well.

EDIT: Just please post links from each site in case anyone does want to help at either -- saves anyone doing work that's already done. :)

HTH,

Imdabaum
09-13-2006, 11:42 AM
Ken you are amazing. Thanks for responding. I was able to roll back and create a new replica for him, but the data file wasn't backed up so we have updated tables. Luckily everything works because I didn't remove any data fields only added additional ones. So the emergency phase is over.. and it's time to bust my end to figure out what's going on in that synchronize function.

Thanks again Ken.

Ken Puls
09-13-2006, 11:54 AM
Well, thanks... I don't really know that I did too much there though...

Imdabaum
09-15-2006, 07:35 AM
Well granted my problem isn't solved, I guess I was just grateful that someone replied and most of all I was grateful that I had backed up the previouse version so I could roll back... And I still have a job since I was able to roll back.

Ken Puls
09-15-2006, 08:32 AM
I'd say it's a "good on you" then, not a thanks to me. ;)

Imdabaum
09-27-2006, 01:00 PM
In case anyone ever has issues synchronizing just forms and not data. I found the solution to the problem I was having. Now I just have to make the checks in the synchronization function. Here's what I found.

http://support.microsoft.com/kb/q282977/:clap2:

In short what I found is this:

Call SynchronizeDBs("C:\MyRepl.mdb", "L:\OtherRepl.mdb", 2)

Sub SynchronizeDBs(strDBName As String, strSyncTargetDB As String, _
intSync As Integer)

Dim dbs As DAO.Database

Set dbs = DBEngine(0).OpenDatabase(strDBName)

Select Case intSync
Case 1 'Synchronize replicas (bidirectional exchange).
dbs.Synchronize strSyncTargetDB, dbRepImpExpChanges
Case 2 'Synchronize replicas (Export changes).
dbs.Synchronize strSyncTargetDB, dbRepExportChanges
Case 3 'Synchronize replicas (Import changes).
dbs.Synchronize strSyncTargetDB, dbRepImportChanges
Case 4 'Synchronize replicas (Internet).
dbs.Synchronize strSyncTargetDB, dbRepSyncInternet
End Select

dbs.Close
End Sub

Now my next question to research will be if there is a way to check if the database is the design master and then run the case accordingly.

Learning is fun.. hard... but fun

Imdabaum
09-27-2006, 01:39 PM
Found these codes on a Microsoft post regarding detecting if the database you are synchronizing is the design master...


Function IsDesignMaster(strDB As String) As Boolean
Dim rep As JRO.Replica
Set rep = New JRO.Replica
' Open Database passed as argument
rep.ActiveConnection = strDB
' Initialize return code to False
IsDesignMaster = False

If Len(rep.ReplicaId & "") > 0 Then
If rep.DesignMasterId = rep.ReplicaId Then
IsDesignMaster = True
End If
End If
End Function



To perform the same action by using DAO, you can use code that is similar to the following:

Public Function IsDesignMaster(strDBName) As Boolean
Dim dbs As DAO.Database
' Initialize return code to False
IsDesignMaster = False
' Open Database passed as argument
Set dbs = OpenDatabase(strDBName)

If Len(dbs.ReplicaID & "") > 0 Then
If dbs.DesignMasterID = dbs.ReplicaID Then
IsDesignMaster = True
End If
End If
End Function


So I'll be working this into the enhancement I just did and see if I can send these forms out without losing the entire database.

Wish me luck.

Ken Puls
09-27-2006, 03:09 PM
Definately best of luck. Let us know how it turns out!

Imdabaum
09-28-2006, 10:55 AM
Well I tested it yesterday and was able it seemed to work fine. I synchronized from the DesignMaster to a replica and from a replica to the Design master. Each time the code checked and when the replica was the target Then the Forms/reports were exported over the existing replica forms/reports.

When the DesignMaster was the target it exported the Changed Forms, and updated the data tables as well. Which is what I was looking for. When I came in to retest this morning. The designMaster crashed after i opened it.... I don't know enough about recovering a corrupted mdb so it looks like it's back to design and re coding everything.