Chinese - Simplified   Dutch   English - United States   French   German   Portuguese - Iberian   Spanish  


Usenet Posting #12 - Trigeminal Software, Inc. (English)

Subject: INFO: You can't mix Jet 3.5 and Jet 4.0 when it comes to replication
(Originally posted 8/4/99)
My daddy told me a long time ago that you can't mix scotch and bourbon. You know what? He is right. And in that same spirit (spirits?), there is something else you cannot mix: versions of Jet when dealing with replicated apps.

Many people use the traditional plan when upgrading to a newer version of Access whereby they keep the backend in the old version for a while so the frontend does not have to be upgraded right away. Thus you can keep the backend in Jet 2.x even if the front-end is in Jet 3.x for some users.

However, when you move from Jet 3.x /3.5x to Jet 4.x, this will not work if the backend is a replica.

Why not? Well, remember that everything you do in a replicated db is "audited" by the Jet tracking layer, which does the work to make sure any change you make is properly applied to other replicas when synchronizing. This tracking layer understands the schema of the replication system tables and what it has to do in order to keep track of things.

However, the tracking layer does not keep total memory of all versions and how to apply those changes; it only does the current version. Therefore, there is no way that an application using Jet 4.0 (like Access 2000, DAO 3.6, or the 4.0 Jet OLE DB provider) can make data changes to a Jet 3.x or 3.5x replica; if it did, then the replicated app would diverge from the replica set as more and more changes were made that were not applied to other replicas.

In DAO, trying to change/add/delete data will result in runtime error 3703: "Operation not supported on replicable databases that have not been converted to the current version."

For a sample of this problem, try to run the following code on a machine that has both Jet 3.5 and Jet 4.0 on it:

Sub foo()
    Dim dbe As Object
    Dim db As Object
    Dim tdf As Object
    Dim fld As Object
    Dim prp As Object
    Dim rs As Object

    Set dbe = CreateObject("DAO.DBEngine.35")
    Set db = dbe.CreateDatabase("c:\temp\test.mdb", _
    Set tdf = db.CreateTableDef("Table1")
    Set fld = tdf.CreateField("Field1", 10, 255)
    tdf.Fields.Append fld
    db.TableDefs.Append tdf
    Set prp = db.CreateProperty("Replicable", 10, "T")
    db.Properties.Append prp
    Set db = Nothing
    Set dbe = Nothing

    Set dbe = CreateObject("DAO.DBEngine.36")
    Set db = dbe.OpenDatabase("c:\temp\test.mdb")
    Set rs = db.OpenRecordset("Table1")
    rs!Field1 = "test data"

    Set rs = Nothing
    Set db = Nothing
    Set dbe = Nothing
End Sub

You will get the runtime error when trying to run rs.AddNew. The same will happen during Edit or Delete, or when trying to run action queries, etc. Basically, the data will be read-only.

So you have three choices:

1) Upgrade the backend to Jet 4.0

2) Keep it in 3.5, but do all work to update the db programmatically either through DAO 3.5 (using CreateObject as above) or the 3.5 Jet OLE DB provider (as a bonus of the latter, you could use form recordsets, as they will accept Jet OLE DB recordsets, even from the 3.5 provider).

3) Don't upgrade frontend or backend

Back to Usenet Musings

Problems with this site? Please contact the
with your comments, questions, or suggestions.