ODE97: Correct Syntax for Internet Synchronization Using DAO

Last reviewed: October 8, 1997
Article ID: Q170595
The information in this article applies to:
  • Microsoft Access 97
  • Microsoft Office Developer Edition 97

SUMMARY

Advanced: Requires expert coding, interoperability, and multiuser skills.

This article demonstrates how to synchronize database replicas over the Internet using data access objects (DAO). This article assumes you have already installed and configured Microsoft Replication Manager on your Internet server to synchronize replicas over the Internet.

For more information about configuring Replication Manager on your Internet server, search the Microsoft ODE Tools Help Index for "Replication Manager, Internet or intranet servers."

This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to the "Building Applications with Microsoft Access 97" manual.

MORE INFORMATION

You can use Synchronize method of DAO for synchronizing database replicas. The Synchronize method uses the following syntax:

   <database object>.Synchronize pathname, [exchange]

When synchronizing replicas over a local area network, you must specify the local area network path of the replica you want to synchronize with for the pathname argument. When synchronizing replicas over the Internet, you must specify the Uniform Resource Locator (URL) address of the Internet server for the pathname argument, instead of specifying a local area network path. In addition, you must specify the dbRepSyncInternet constant for the exchange argument.

When supplying the URL address of the Internet server, your code does not need to supply the full path to the replica on the server. For instance, if your Internet server name is "MyServer" and contains a replica named "Northwind.mdb" in a shared "Scripts" folder, you would use the syntax:

    Sub SyncReplicas()
       Dim db As Database
       Set db = CurrentDb()
       db.Synchronize "http://MyServer", dbRepSyncInternet
    End Sub

NOTE: Synchronization is bidirectional by default. For more control over the direction of the exchange, you can add one of the other exchange constants (dbRepImportChanges or dbRepExportChanges) to the constant dbRepSyncInternet. For example:

   db.Synchronize "http://MyServer", dbRepSyncInternet + dbRepExportChanges

REFERENCES

For more information about the Synchronize method, search the Help Index for "Synchronize method," or ask the Microsoft Access 97 Office Assistant.

For more information about synchronizing replicas over the Internet, please refer to the Microsoft Jet 3.5 Replication White Paper. See the following article in the Microsoft Knowledge Base for instructions on obtaining the Microsoft Jet 3.5 Replication White Paper:

   ARTICLE-ID: Q164553
   TITLE     : ACC97: Jet 3.5 Replication White Paper Available on MSL
Keywords          : GnlOthr MdlDao kbcode
Version           : 97
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.