I have a replicated database. The replicas only contain tables. The users have a front end for their replica. I have a cmd button in my front end to cause the replica to synchronize
This works. The problem is if there are any record conflicts. I do not get a window or a way to resolve the conflicts because I never actually open the replica. If I run the above code and then open the actual replica, the conflicts window appears. I think I could just open the replica from the frontend after the synchronization but this would get a little confusing. Questions:
1)Anyway to check if conflicts exist? Because I could then synch from the frontend, open the replica, and if no conflicts close the replica. If there are conflicts then I would leave the replica open
2)Anyone ever do something like this and have a better strategy for synching from another DB?
The reason for replication, is that the dbs are often used disconnected from a network.
Code:
Public Sub startSynchReplica()
On Error GoTo errLbl:
Dim strBackend As String
Dim dbReplica As Database
Dim app As New Application
Dim synchPath As String
Dim rtn As Long
synchPath = "some path"
strBackend = CurrentDb.TableDefs("Tasks").Connect
strBackend = Mid(strBackend, 11)
Do Until FileExists(synchPath)
rtn = MsgBox("Can not find Master Daster Base. Please select OK to search or CANCEL to cancel synch.", vbOKCancel, "Search for Master")
If rtn = vbCancel Then
Exit Sub
End If
synchPath = fGetFileName
Loop
Set dbReplica = OpenDatabase(strBackend)
dbReplica.Synchronize synchPath, dbRepImpExpChanges
Set dbReplica = Nothing
Exit Sub
errLbl:
Call errHandler(Err.Number, Err.Description, "Error in startSynchReplica")
End Sub
This works. The problem is if there are any record conflicts. I do not get a window or a way to resolve the conflicts because I never actually open the replica. If I run the above code and then open the actual replica, the conflicts window appears. I think I could just open the replica from the frontend after the synchronization but this would get a little confusing. Questions:
1)Anyway to check if conflicts exist? Because I could then synch from the frontend, open the replica, and if no conflicts close the replica. If there are conflicts then I would leave the replica open
2)Anyone ever do something like this and have a better strategy for synching from another DB?
The reason for replication, is that the dbs are often used disconnected from a network.