473,395 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Auto Syncing Replicas

9
We are lucky and get to run an 11 year old version of Access (97). I have set up a master with 5 replicas. These are located on various network drives in our organization. Is there any macro/code I can use to have the master auto sync each of the replicas when opened? the Microsoft website sucks and didn't help me at all. I would love any advice or help.
Sep 26 '08 #1
11 4105
NeoPa
32,556 Expert Mod 16PB
Can you be clearer as to what, EXACTLY, you want to have happen.
Sep 26 '08 #2
jzalar
9
Can you be clearer as to what, EXACTLY, you want to have happen.

I would like to have a button on the master that automatically (without pop up and choices) syncs all of the replicas to the master.
Sep 26 '08 #3
NeoPa
32,556 Expert Mod 16PB
I'm afraid if that's as clear as you can be then I'm unable to help.
Sep 26 '08 #4
Look in Access Help for more info on this. I got in to this a bit a couple of years ago. Unless you're a programmer-extraordinare, it's a lot easier just to open the master, then do the Tools...Replication...Synchronize Now.
Sep 26 '08 #5
jzalar
9
I'm afraid if that's as clear as you can be then I'm unable to help.

Sorry about the confusion. I am looking for "Replication Code" that I can put into a macro that will run the sync procedure out of sight of the user. The only thing I found was from the Microsoft website http://support.microsoft.com/kb/183710/en-us

This is kind of what I need, but an actual working same so I can change the BD names and paths.
Sep 26 '08 #6
ADezii
8,834 Expert 8TB
!!!WARNING - this code exists only in the crevices of my mind! (LOL)! It has not been tested, since I do not have the means to, and I make no guarantee whatsoever as to how well it will work, or if it will even work at all. DO NOT USE THIS CODE ON THE LIVE MASTER AND REPLICAS! All that being said:
  1. Create a Table named tblReplicas, and within this Table create a single Field name [Replica_Path].
  2. Create 5 New Records in tblReplicas consisting of the 'Absolute' Network Path of the 5 Replicas, including the Database Name, such as:
    K:\Server4\Databases\Replicas\Replica_1.mdb
  3. Depending on how you want the Replication Process to perform, namely: MASTER ==> Replica, Replica ==> MASTER, MASTER <==> Replica, select 1 of the 3 With..End With code segments below.
    Expand|Select|Wrap|Line Numbers
    1. 'To Send changes from the MASTER to the Replica
    2. With rstReplicas
    3. --Do While Not .EOF
    4. ----MyDB.Synchronize ![Replica_Path], dbRepExportChanges
    5. ----.MoveNext       '.MoveNext
    6. --Loop
    7. End With
    8. ---
    9. 'To have the MASTER receive changes from the Replica
    10. With rstReplicas
    11. --Do While Not .EOF
    12. ----MyDB.Synchronize ![Replica_Path], dbRepImportChanges
    13. ----.MoveNext
    14. --Loop
    15. End With
    16. ---
    17. 'Changes from both the MASTER and Replica are exchanged
    18. '(Default - Bi-directional exchange)
    19. With rstReplicas
    20. --Do While Not .EOF
    21. ----MyDB.Synchronize ![Replica_Path], dbRepImpExpChanges
    22. ----.MoveNext
    23. --Loop
    24. End With
  4. Execute the following code from 'within the MASTER'.
    Expand|Select|Wrap|Line Numbers
    1. Dim MyDB As DAO.Database
    2. Dim rstReplicas As DAO.Recordset
    3. ---
    4. Set MyDB = CurrentDb()
    5. ---
    6. Set rstReplicas = MyDB.OpenRecordset("tblReplicas", dbOpenForwardOnly)
    7. ---
    8. With rstReplicas
    9. --Do While Not .EOF
    10. ----'Use only [1] of 3 Synchronize Options listed below
    11. ----MyDB.Synchronize ![Replica_Path], dbRepExportChanges
    12. --- ------------------------ OR
    13. ----MyDB.Synchronize ![Replica_Path], dbRepImportChanges
    14. --- ------------------------ OR
    15. ----MyDB.Synchronize ![Replica_Path], dbRepImpExpChanges
    16. --- ------------------------ OR
    17. ----.MoveNext
    18. --Loop
    19. End With
    20. ---
    21. rstReplicas.Close
    22. Set rstReplicas = Nothing
  5. If you need any explanation on the code, either muself or one of the other Members will assist you.
  6. Say a Prayer, and let me know how you make out.
Sep 27 '08 #7
jzalar
9
Will be trying it today. Thank you for the help.
Sep 29 '08 #8
ADezii
8,834 Expert 8TB
Will be trying it today. Thank you for the help.
Kindly let me know the outcome, I'm interested myself.
Sep 29 '08 #9
jzalar
9
Kindly let me know the outcome, I'm interested myself.
Sorry for the delay but I had to go to Ny for work and this wasn't part of that work. I tried it today but I can get it to run. I am not very good with VB so I keep getting complier error when debuging. This is what I used.

Expand|Select|Wrap|Line Numbers
  1.  Dim MyDB As DAO.Database
  2. Dim rstReplicas As DAO.Recordset
  3.  
  4. Set MyDB = CurrentDb()
  5.  
  6. Set rstReplicas = MyDB.OpenRecordset("tblReplicas", dbOpenForwardOnly)
  7.  
  8. With rstReplicas
  9. Do While Not .EOF
  10.     MyDB.Synchronize ![Replica_Path], dbRepImpExpChanges
  11. .MoveNext
  12. Loop
  13. End With
  14.  
  15. rstReplicas.Close
  16. Set rstReplicas = Nothing
  17.  
For some reason it does not like "Set MyDB" Not sure why.
Oct 10 '08 #10
ADezii
8,834 Expert 8TB
Sorry for the delay but I had to go to Ny for work and this wasn't part of that work. I tried it today but I can get it to run. I am not very good with VB so I keep getting complier error when debuging. This is what I used.

Expand|Select|Wrap|Line Numbers
  1.  Dim MyDB As DAO.Database
  2. Dim rstReplicas As DAO.Recordset
  3.  
  4. Set MyDB = CurrentDb()
  5.  
  6. Set rstReplicas = MyDB.OpenRecordset("tblReplicas", dbOpenForwardOnly)
  7.  
  8. With rstReplicas
  9. Do While Not .EOF
  10.     MyDB.Synchronize ![Replica_Path], dbRepImpExpChanges
  11. .MoveNext
  12. Loop
  13. End With
  14.  
  15. rstReplicas.Close
  16. Set rstReplicas = Nothing
  17.  
For some reason it does not like "Set MyDB" Not sure why.
Make sure you have a Reference set to the Microsoft DAO X.X Object Library
Oct 10 '08 #11
NeoPa
32,556 Expert Mod 16PB
For some reason it does not like "Set MyDB" Not sure why.
Do you have a reference (Tools / References...) set to Microsoft DAO 3.6 Object Library (or similar version)?

PS. Possibly needed to refresh the page before replying - but I was doing some testing. I did find that this reference is not set automatically (Would have thought it would be).
Oct 10 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Glabbeek | last post by:
I'm changing the layout of my site. Instead of using tables, I will use DIVs. It's working fine, except for 1 thing: In IE6 some DIVs are not the correct width. Mozilla and Opera are showing the...
0
by: Ralph Krausse | last post by:
Hello, I am looking for some software developers that would test my software that allows syncing of databases and records between a Windows application and a Palm PDA with NO HotSync involved....
1
by: tgru | last post by:
I have taken over a transactional replication setup that is being used for fault tolerance (I know, I know...). The scenario I am concerned with is where the publisher goes down due to failure,...
5
by: Ken Massey | last post by:
First let me say I'm not interested in replication. I want to sync a target database with a source database at regular intervals (say weekly), but in the intermediate time they may differ. The...
0
by: Suse Baeriswyl | last post by:
Hello newsgroup, thanks to David's help I will try to rebuild my replicas with "smaller" dimensions in order to avoid the massages concerning numbers of tables the tombstone-table. Does...
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
0
by: Macbane | last post by:
Hi All, Hope someone can help me with this. I have some PDA database software which sync with tables in an access database on my computer. It works fine until you want to sync tables that...
1
by: blackjasmine456 | last post by:
I have a FLV set up with cue points that link to graphic files in my flash document. The FLV is imported into flash 8, and cue points are set upon import to jump to specific frame labels in my...
0
by: BluFalco | last post by:
Hey all, Im looking for some advise from developpers that have experience with eDir. Basically, I want to know how can i test replicas for synchronization? Is it enough to compare the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.