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


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

Subject: INFO: Creating a "prevent deletes" replica in Jet 4.0
(Originally posted 7/5/99)
A very cool feature added to Jet 4.0 replication... the ability to create replicas (even partial replicas) where data can be added or changed, but cannot be deleted. Unfortunately, it was not added to JRO (Jet and replication objects), it is not exposed through Replication Manager, and no changes were made to DAO for replication this version.

So the only way to create these useful little beasts is to either:

1) Use the Access UI (which does not expose a programmatic interface)
2) Use the latest TSI Synchronizer
3) Use a small hidden way to do it via DAO's MakeReplica method!

What is this hidden way? Well, the third (optional) "Options" parameter has two documented choices for this bitmask:

Const dbRepMakePartial = 1
Const dbRepMakeReadOnly = 2
but trial and error has determined you can also use in combo or instead of the above (just define it somewhere):

Const dbRepMakePreventDeletes = 4

Just call:

db.MakeReplica "c:\foo.mdb", "", _ dbRepMakePreventDeletes Or dbRepMakePartial

and you create a partial replica where no deletes can happen!

Just to round out the useful constants, you can pick *any one* of the following (they cannot be combined) to handle replica visibility. Note that JRO exposes a way to do this, too, but I prefer to keep all my eggs in one basket at a time:

Const dbRepGlobalReplica = &H1000
Const dbRepLocalReplica = &H2000
Const dbRepAnonymousReplica = &H4000

(global replicas are created by default if no flag is specified, they are known to all other replicas in the set. Local replicas are only known by the replica who created them. Anonymous replicas are not know by anybody at all, and it can only synch with its parent -- useful for Internet sites that do not want to track every single replica out there that is given to a customer, for example).

The latest TSI Synchronizer exposes all of these new Jet 4.0 features in synch40.dll, as well. But if you are not using the TSI Synchronizer already, the DAO solution is an easy, quick way to expand the replica creation process.

Back to Usenet Musings

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