Group:  Microsoft Access ยป microsoft.public.access.replication
Thread: Yet another sync question

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Yet another sync question
"larsdennert[ at ]gmail.com" <larsdennert[ at ]gmail.com> 04.03.2006 18:11:16
I am currently direct synching two replica Access2K dbs over a
hardware VPN running on DSL modems. I'd like to progamatically have
them synch. The users currently have to select the correct replica to
synch too from the menus. The users are both locations share each
replica with the exceptioin of some laptops/tablets that synch their
replicas when they get within wireless range. I tried some test code
like this but no luck. Access doesn't recognize the type dao.database
or database as a user defined type.

Public Sub synctest()
Dim mydb As dao.Database
Set mydb = OpenDatabase("p:\backup\cypress.mdb")
mydb.SYNCHRONIZE "p:\cypress.MDB", dbRepImpExpChanges
mydb.Close
synctest = 0
End Sub

This brings me to the second item. I do not have Replication manager.
Is that needed for direct programatic synch? I'd love to do Indirect
but I don't have Replman. I downloaded TSI but the instructions don't
even say where to put the DLL much less how to get it linked and
working and from reading you need Replman anyway.

My corruption solution, albeit bad, is a macro that issues a runcommand
:"cmd /c copy mydb mydbbackup", runs a msgbox "backup complete", and
then does a sendkeys "%tps" to bring up the synch menu for the user.
Messy I know. I can't even use the SynchronizeNow function from a macro
because Access deadlocks. Maybe because the macro is waiting for the
synch to finish and synch is waiting for the macro to finish and unlock
something.

So there it is. If anyone has any ideas to further my effort it would
be appreciated greatly. I've written a fair amount of back end code in
this db and I'm not shy about writing more. I'm still learning VB
though as my programming background is in C and Pascal.

Re: Yet another sync question
"David W. Fenton" <XXXusenet[ at ]dfenton.com.invalid> 04.03.2006 19:38:03
"larsdennert[ at ]gmail.com" <larsdennert[ at ]gmail.com> wrote in
news:1141495875.957882.143010[ at ]i40g2000cwc.googlegroups.com:

[Quoted Text]
> I am currently direct synching two replica Access2K dbs over a
> hardware VPN running on DSL modems. I'd like to progamatically
> have them synch. The users currently have to select the correct
> replica to synch too from the menus. The users are both locations
> share each replica with the exceptioin of some laptops/tablets
> that synch their replicas when they get within wireless range. I
> tried some test code like this but no luck. Access doesn't
> recognize the type dao.database or database as a user defined
> type.

You obviously don't have a reference to DAO. When in the VBE window,
go to the Tools menu and choose References. Look for Microsoft DAO
3.6 Object Library and check it.

> Public Sub synctest()
> Dim mydb As dao.Database
> Set mydb = OpenDatabase("p:\backup\cypress.mdb")
> mydb.SYNCHRONIZE "p:\cypress.MDB", dbRepImpExpChanges
> mydb.Close
> synctest = 0
> End Sub

The code will then run, but I would *never* advocate doing a direct
synch (which is what you're initiating there) over a DSL Internet
connection -- that's simply not enough bandwidth.

> This brings me to the second item. I do not have Replication
> manager. Is that needed for direct programatic synch? I'd love to
> do Indirect but I don't have Replman. I downloaded TSI but the
> instructions don't even say where to put the DLL much less how to
> get it linked and working and from reading you need Replman
> anyway.

You can get everything you need to do indirect replication by
applying the Jet 4.0 replication security patch, which installs the
Jet synchronizers for indirect and Internet replication. However,
one person who tried to get indirect replication working with that
could not make it work on PCs that did not have replication manager
installed. Given that replication manager does not have to be
running for it to work, and given that there are no DLLs installed
with ReplMan that are referenced by the synchronizers, I suspect
there's some registry keys missing that ReplMan creates.
Unfortunately we never tracked down what those were.

So, basically, the long and the short of it is that you need to get
ReplMan.

> My corruption solution, albeit bad, is a macro that issues a
> runcommand
>:"cmd /c copy mydb mydbbackup", runs a msgbox "backup complete",
>:and
> then does a sendkeys "%tps" to bring up the synch menu for the
> user. Messy I know. I can't even use the SynchronizeNow function
> from a macro because Access deadlocks. Maybe because the macro is
> waiting for the synch to finish and synch is waiting for the macro
> to finish and unlock something.

A direct synch over DSL will take hours. Direct synch has to open
the replicas on both sides of the synch, which means pulling the
remote replica file across the wire into RAM on the local PC. This
is why it's a bad idea, because if there's any glitch in
connectivity, you could corrupt the remote replica.

> So there it is. If anyone has any ideas to further my effort it
> would be appreciated greatly. I've written a fair amount of back
> end code in this db and I'm not shy about writing more. I'm still
> learning VB though as my programming background is in C and
> Pascal.

You might look into getting the Jet 4 security patch and seeing if
you can get it to work without installing ReplMan.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Re: Yet another sync question
"larsdennert[ at ]gmail.com" <larsdennert[ at ]gmail.com> 04.03.2006 20:01:44
David,
I want to thank you for the reply! The ref to DAO looks like it will
work. The code compiled! I'll mess with it when I get the time. I
figured I was missing something simple.

I'll keep trying to work in indirect. I do have that update but haven't
tried it. I wanted to get programmatic synch to work first. We have
been direct synching for years with this db and it only takes a few
minutes to do a direct sync. The mdb's are less than 20MB. We did have
a few corruptions when one of our DSL lines had a bad phone fuse.

Re: Yet another sync question
"David W. Fenton" <XXXusenet[ at ]dfenton.com.invalid> 05.03.2006 19:30:14
"larsdennert[ at ]gmail.com" <larsdennert[ at ]gmail.com> wrote in
news:1141502504.210528.188000[ at ]z34g2000cwc.googlegroups.com:

[Quoted Text]
> I'll keep trying to work in indirect. I do have that update but
> haven't tried it. I wanted to get programmatic synch to work
> first. We have been direct synching for years with this db and it
> only takes a few minutes to do a direct sync. The mdb's are less
> than 20MB. We did have a few corruptions when one of our DSL lines
> had a bad phone fuse.

Direct synch across a LAN is fine. Across DSL, I wouldn't do, no
matter how big the pipe.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net