Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » MobiLink - Client Administration » DBTools Interface for dbmlsync

Introduction to DBTools interface for dbmlsync Next Page

Setting up the DBTools interface for dbmlsync


This section guides you through the basic steps for using the DBTools interface for dbmlsync.

For more information about the DBTools library, see Introduction to the database tools interface.

For more information about using import libraries for your development environment, see Using the database tools interface.

To configure and start dbmlsync using the DBTools interface in C or C++
  1. Include the DBTools header file.

    The DBTools header file, dbtools.h, lists the entry points to the DBTools library and defines required data types.

    #include "dbtools.h"
  2. Start the DBTools interface.

  3. Initialize the a_sync_db structure.

    For more information about a_sync_db fields, see a_sync_db structure.

  4. Create callback functions to receive feedback during synchronization and assign these functions to the appropriate a_sync_db fields.

    The following functions use the standard output stream to display dbmlsync error, log, and progress information.

    For more information about DBTools callback functions, see Using callback functions.

  5. Create a linked list of a_syncpub structures to specify which publications should be synchronized.

    Each node in the linked list corresponds to one instance of the -n option on the dbmlsync command line.

    You can create a linked list of a_syncpub structures. Each a_syncpub instance in the linked list is equivalent to one specification of the -n option on the dbmlsync command line.

    See -n option and a_syncpub structure.

  6. Run dbmlsync using the DBSynchronizeLog function.

    In the following code listing, sync_ret_val contains the return value 0 for success or non-0 for failure.

    short sync_ret_val;
    printf("Running dbmlsync using dbtools interface...\n");
    sync_ret_val = DBSynchronizeLog(&dbsync_info); 
    printf("\n Done... synchronization return value is: %I \n", sync_ret_val);
    

    You can repeat step 6 multiple times with the same or different parameter values.

  7. Shutdown the DBTools interface.

    The DBToolsFini function frees DBTools resources.

    DBToolsFini( &info );

    See DBToolsFini function.