|
|
[edit] Why should I split my database?Splitting an Access application is essential whether or not you are using replication. Tony Toews explains it quite well for non-replicated applications: http://www.granite.ab.ca/access/splitapp/why.htm The Table of Contents of his detailed discussion of how to do it is here: http://www.granite.ab.ca/access/splitapp/index.htm Replication adds an even more important reason for splitting, and that is:
Now, you may think that Microsoft has suggested in its documentation that it works fine, and you'd be right. Indeed, in the article Things not to believe in the MS documentation I've highlighted where MS is wrong, and has corrected its documentation. [edit] Why is replication not a good way to distribute changes to a front end application?[edit] Why can't I email replicas/dropbox files for synchronization?[edit] I can never connect my computer to a network. Can I still use Jet Replication?[edit] What is a "dead replica?"This Usenet post has a lengthy explanation: http://groups.google.com/group/comp.databases.ms-access/msg/9f5a84194fa6c653 Here is the text from that message: Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!gnilink.net!cyclone.rdc-nyc.rr.com!news-out.nyc.rr.com!twister.nyc.rr.com.POSTED!not-for-mail Newsgroups: comp.databases.ms-access Subject: Re: Replication From: "David W. Fenton" [edit] Can I use DAO to initiate an indirect synch in code?No. In Jet 3.5 or 4.0, DAO can only do a Direct or Internet synch:Once you pass a constant for the second optional argument of the Synchronize method, the default, which is dbRepImpExpChanges, is no longer operative. The other two options are dbRepImportChanges and dbRepExportChanges.
Dim dbLocal As DAO.Database
Set dbLocal = DBEngine.OpenDatase("C:\PathToYourLocalReplica\LocalReplica.mdb")
' DIRECT SYNCH
dbLocal.Synchronize "\\Server\Share\RemoteReplica.mdb"
' INTERNET SYNCH
dbLocal.Synchronize "\\Server\Share\RemoteReplica.mdb", dbRepImpExpChanges + dbRepSyncInternet
dbLocal.Close
Set dbLocal = Nothing
To initiate an Indirect synch in code, you need the TSI Synchronizer (Jet 3.5 or 4.0), or in Jet 4.0, JRO. TSI SYNCHRONIZER CODE JRO CODE Notes: [edit] How can I get column-level conflict checking in a replica set converted from Jet 3.x to Jet 4.0?When you convert from a Jet version before 4, the older default bahavior (row-level conflict tracking) is retained, so the ColumnLevelTracking property is set to FALSE. You cannot change this property in a replicated table. The only way to change the ColumnLevelTracking property is to unreplicate the table, uncheck the Row-Level Tracking checkbox in the table properties, then re-replicate it. This, of course, has to be done in the Design Master. Also, you can't unreplicate a table that participates in relationships, so you'll need to remove relationships, unreplicate, uncheck row-level tracking, and then re-replicate, and restore the relationships. The quick checklist:
For tables that have no relationships, you obviously skip steps 2 and 6. You might want to attempt step 3 first, because it will tell you if there are relationships, or just work from the printout created in step 1. [edit] How can I tell if I have conflicts after a synchronization?There are three different approaches to this. One looks for conflict tables in the TableDefs collection, one pokes into a system table to get a list of conflict tables, and the other looks at table properties of TableDefs. 1. Search TableDefs by name
Dim dbReplica As DAO.Database
Dim tdf As DAO.TableDef
Dim strTableName As String
Dim strConflictTables As String
Dim strTablesWithConflicts As String
Set dbReplica = DBEngine.Opendatabase([path/name of replica])
For Each tdf In dbReplica
strTableName = tdf.Name
If Right(strName,9)="_Conflict" Then
strConflictTables = strConflictTables _
& ", " & strTableName
strTablesWithConflicts = strTablesWithConflicts _
& ", " & Left(strTableName,Len(strTableName)-9)
End If
Next tdf
strConflictTables = Mid(strConflictTables, 3)
strTablesWithConflicts = Mid(strTablesWithConflicts, 3)
' Do something with the two lists at this point
Set tdf = Nothing
dbReplica.Close
Set dbReplica = Nothing
2. Use the MSysSideTables system table to get the list
Dim dbReplica As DAO.Database
Dim rs As DAO.Recordset
Dim strSideTable As String
Dim strConflictTables As String
Dim strTablesWithConflicts As String
Set dbReplica = DBEngine.Opendatabase([path/name of replica])
strSQL = "SELECT MSysSideTables.SideTable FROM MSysSideTables"
strSQL = strSQL & " ORDER BY MSysSideTables.SideTable;"
Set rs = dbReplica.OpenRecordset(strSQL)
With rs
If Recordcount > 0 Then
Do Until .EOF
strSideTable = !SideTable
strConflictTables = strConflictTables _
& ", " & strSideTable
strTablesWithConflicts = strTablesWithConflicts _
& ", " & Left(strSideTable,Len(strSideTable)-9)
Loop
End If
End With
strConflictTables = Mid(strConflictTables, 3)
strTablesWithConflicts = Mid(strTablesWithConflicts, 3)
' Do something with the two lists at this point
rs.Close
Set rs = Nothing
dbReplica.Close
Set dbReplica = Nothing
3. Search TableDefs for ConflictTable property
Dim dbReplica As DAO.Database
Dim tdf As DAO.TableDef
Dim strConflictTables As String
Dim strTablesWithConflicts As String
Set dbReplica = DBEngine.Opendatabase([path/name of replica])
For Each tdf In dbReplica
if tdf.ConflictTable <> vbNullString Then
strTablesWithConflicts = strTablesWithConflicts _
& ", " & tdf.Name
strConflictTables = strConflictTables _
& ", " & tdf.ConflictTable
End If
Next tdf
strConflictTables = Mid(strConflictTables, 3)
strTablesWithConflicts = Mid(strTablesWithConflicts, 3)
' Do something with the two lists at this point
Set tdf = Nothing
dbReplica.Close
Set dbReplica = Nothing
4. Use JRO to get the list of tables (code based on code in question 32 of the Jet 4.0 FAQ)
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim repRW As New JRO.Replica
Dim strConflictTables As String
Dim strTablesWithConflicts As String
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data source=C:\demo\NWindRW.mdb;"
repRW.ActiveConnection = conn
Set rs = repRW.ConflictTables
rs.MoveFirst
While NOT rs.EOF
strTablesWithConflicts = strTablesWithConflicts _
& ", " & rs(1)
strConflictTables = strConflictTables _
& ", " & rs(0)
rs.MoveNext
Wend
strConflictTables = Mid(strConflictTables, 3)
strTablesWithConflicts = Mid(strTablesWithConflicts, 3)
' Do something with the two lists at this point
rs.Close
Set rs = Nothing
conn.Close
Note that in Jet 4.0, conflicts are reported at all replicas, while in Jet 3.x, conflicts were reported only in the replica that had the losing record. Note also that before Jet 4.0, replication errors and design errors were reported in separate side tables, so if you're using the MSysSideTables method (#2), you will want to check which kind of side table is listed. [edit] How does one set up indirect replication if you don't have Replication Manager?See the article setting up indirect replication without Replication Manager. [edit] I have a replicated MDB and I don't want it to be replicated any more. What do I do?You need to unreplicate your MDB. Before doing so, you might want to synchronize with all the replicas to make sure you have all the data (though if you're contemplating unreplicating, you're unlikely to have been using replication recently). Microsoft provides instructions on how to do this manually:
The A97 article also has a download link for the Jet 3.5 unreplication wizard: There are two other tools that also work for Jet 4 databases:
[edit] Can Jet Replication synchronize with database servers?Yes! There are at least two platforms that Jet can participate with in "heterogeneous replication," one is MS SQL Server (before version 2005), and the other is IBM's DB2.
|
| This page was last modified 00:08, 7 September 2009. This page has been accessed 517 times. Disclaimers |