synchronizing

G

Guest

I have placed a "synchronize" button on my main form but do not know how to
link it to the action of synchronizing to the master design. I have limited
experience with code, but know a little bit.

Thanks, Linda
 
J

John W. Vinson

I have placed a "synchronize" button on my main form but do not know how to
link it to the action of synchronizing to the master design. I have limited
experience with code, but know a little bit.

Thanks, Linda

Could you explain what you want this button to do? What are you synchronizing
with what? What is the form's Recordsource, and what is "the master design"???


John W. Vinson [MVP]
 
D

David W. Fenton

I have placed a "synchronize" button on my main form but do not
know how to link it to the action of synchronizing to the master
design. I have limited experience with code, but know a little
bit.

First off, you shouldn't be synchronizing on a regular basis with
your Design Master. If you are, that means you're using it for
production editing, which is a bad thing.

The Design Master of a replica set is a special, one-of-a-kind
replica, and you need to take good care of it. Exposing to the
stress of daily editing is not good.

No replica should have fewer than 3 replicas:

1. design master

2. two replicas, each editing in a different location.

Now, you do need to synch with your DM occasionally, in order to
keep it from expiring, but since the default retention period is
1000 days, unless you've changed that, you don't need to do it more
than once a month or so.

Now, to answer your question:

Assuming that you're synchronizing across a wired LAN connection,
it's very easy to do a synch with DAO:

Dim db As DAO.Database

Set db = DBengine.OpenDatabase("[path/name of replica"])
db.Synchronize "[path/name of the *other* replica"

db.Close
Set db = Nothing

That's is.

Put that code behind a command button or call it from a macro and
attach it to a custom menu and you're set.

Of course, that's only the beginning. Things can go wrong during a
synch, and so you should probably have error checking. And you
should probably check for conflicts, since those really need to be
resolved as soon as they appear.

But that's the basics.

If, however, you *don't* have a wired LAN connection (either
wireless LAN or a WAN or Internet connection), then the answer is
substantially more complex.
 
G

Guest

Thank you; however, I need a few more details so I will give a little more
information. I have people in the field with laptops who need to synch their
DB data to a main source (me - is this the design master or just another
replica I have on my computer? - all - current- information needs to always
reside on my computer after each person synchs).

Also, because of my limited experience with code do I start the code you
gave me, i.e. " Dim db As DAO.Database "... in the code box associated with
the command button?

Should I be using DAO with retention period of 60 days (which is probably
okay) or better off using MS Access with retention period of 1000 days?

thanks for any help.

David W. Fenton said:
I have placed a "synchronize" button on my main form but do not
know how to link it to the action of synchronizing to the master
design. I have limited experience with code, but know a little
bit.

First off, you shouldn't be synchronizing on a regular basis with
your Design Master. If you are, that means you're using it for
production editing, which is a bad thing.

The Design Master of a replica set is a special, one-of-a-kind
replica, and you need to take good care of it. Exposing to the
stress of daily editing is not good.

No replica should have fewer than 3 replicas:

1. design master

2. two replicas, each editing in a different location.

Now, you do need to synch with your DM occasionally, in order to
keep it from expiring, but since the default retention period is
1000 days, unless you've changed that, you don't need to do it more
than once a month or so.

Now, to answer your question:

Assuming that you're synchronizing across a wired LAN connection,
it's very easy to do a synch with DAO:

Dim db As DAO.Database

Set db = DBengine.OpenDatabase("[path/name of replica"])
db.Synchronize "[path/name of the *other* replica"

db.Close
Set db = Nothing

That's is.

Put that code behind a command button or call it from a macro and
attach it to a custom menu and you're set.

Of course, that's only the beginning. Things can go wrong during a
synch, and so you should probably have error checking. And you
should probably check for conflicts, since those really need to be
resolved as soon as they appear.

But that's the basics.

If, however, you *don't* have a wired LAN connection (either
wireless LAN or a WAN or Internet connection), then the answer is
substantially more complex.
 
D

David W. Fenton

I have people in the field with laptops who need to synch their
DB data to a main source

If they are wanting to do this over the Internet or dialup, then you
can't use the code I gave you, which is unsuitable for anything but
a wired LAN connection of 10Mbps or higher speed.
(me - is this the design master or just another
replica I have on my computer? - all - current- information needs
to always reside on my computer after each person synchs).

If you are maintaining the Design Master it should be on your
computer or on a computer accessible to you. The replica you use for
working with the data should not be the DM, but a different replica.
Whether you use that replica as the hub replica that all the remote
users synch with is your choice, but it can cause problems if a
remote user tries to synch while you're editing data. The problems
are almost always transient, but if you're editing memo fields with
found controls, that can cause the lost of the memo data along with
the rest of the record. At the very least, one should use unbound
controls for editing memo data (populated from the form's
recordsource in the form's OnCurrent event and updated in the
AfterUpdate event of the memo's unbound textbox), and better still
is to move your memos to a separate table with only memos in them,
so if any memo gets corrupted, you won't lose anything but the memo
itself.
Also, because of my limited experience with code do I start the
code you gave me, i.e. " Dim db As DAO.Database "... in the code
box associated with the command button?

Should I be using DAO with retention period of 60 days (which is
probably okay) or better off using MS Access with retention period
of 1000 days?

I just don't understand why people choose such short retention
periods -- it's a reciped for disaster (i.e., you miss synching a
replica for such a short period of time and then you have to recover
all the data from it manually).

I would also say this:

If the code I posted is not something you'd be comfortable with,
then you probably need to hire someone to architect indirect
synchronization for you.
 
D

David W. Fenton

I just don't understand why people choose such short retention
periods

I meant to include a caveat about those who set short retention
periods because of MSysTombstone growning too much. If that is
happening, it shows a design error, because it means you are
deleting an inordinate number of records. Likely, it indicates that
you are replicating data that is really temp data and shouldn't be
stored in your replica at all.
 
G

Guest

Thank you David - big help.

David W. Fenton said:
I meant to include a caveat about those who set short retention
periods because of MSysTombstone growning too much. If that is
happening, it shows a design error, because it means you are
deleting an inordinate number of records. Likely, it indicates that
you are replicating data that is really temp data and shouldn't be
stored in your replica at all.
 
D

David W. Fenton

Thank you David - big help.

Please ask more questions! I'm happy to answer them, as one of the
last men standing who knows a damned thing about Jet replication!
 
T

Tom Wickerqueer

there is no such thing as Jet replication

if you are still using Jet for anything you shoudl be fired and then spit
upon
 
D

David W. Fenton

there is no such thing as Jet replication

Whatever you say, Aaron -- you've so well demonstrated how credible
a source of information you are that at this point, one need not
even dispute your erroneous assertions. The mere fact that you're
saying it proves that it's WRONG.
 
G

Guest

Hello,
David did I understand the thread correctly? The DM is the Master table?
Its best to have two master tables one that is synched to on a regular basis
and one that is performed say monthly?
Thanks,
V...
 
D

David W. Fenton

David did I understand the thread correctly? The DM is the Master
table? Its best to have two master tables one that is synched to
on a regular basis and one that is performed say monthly?

The Design Master is not a *table*, but an MDB replica. It is the
first among all the replicas, the only one in which design changes
can be made, and because of that, it needs to be cared for
carefully, as it's the only one that cannot be replaced by a replica
created from another replica in the replica set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top