Starts synchronization between a remote and consolidated database. The syntax you use depends on whether you include command line parameters with the dbmlsync synchronization call.
To start synchronization |
Use |
---|---|
Without including command line parameters |
|
With command line parameters that you include in the synchroniztion call |
Starts synchronization between a remote and consolidated database.
MLSynchronization, MLSync, and ULSync controls
SyncObject.Synchronize ( )
Argument |
Description |
---|---|
syncObject |
The name of the synchronization object. |
Integer. Returns 1 for success and -1 for failure. Any other return value is an error code from dbmlsync.
If all the properties of a synchronization object are initialized, including userids and passwords, it is ready for immediate use. To launch a synchronization requires very little coding, as in the following example for an MLsync object named “nvo_my_mlsync”:
nvu_my_mlsync mySync
Long rc
mySync = CREATE nvo_my_mlsync
mySync.Synchronize()
destroy mySync
You would typically add the above code to the Clicked event for a menu item or a command button on an application window.
Starts dbmlsync synchronization with command line parameters that are passed from the values of a syncparm structure.
MLSync controls
SyncObject.Synchronize (cmdstring )
Argument |
Description |
---|---|
syncObject |
The name of the synchronization object. |
cmdstring |
A read-only string containing command line arguments for a synchronization call. |
Integer. Returns 1 for success and any other value for failure.
The following is an example of a command string for a Synchronize call:
C:\Program Files\Sybase\SQL Anywhere 11\Bin32\ dbmlsync.exe
-c "DSN=salesdb_remote;UID=dba;PWD=sql" -n salesapi
-u 50 -mp "pw10" -wc salesapi_50_sync
-o "C:\temp\dbmlsync.log" -v+ -q -k
If the path to the dbmlsync executable (C:\Program Files\Sybase\SQL Anywhere 11\Bin32\dbmlsync.exe in the above example) is not part of the command string, the application searches the Windows registry to find it.
For MLSync objects, you can allow a user to edit the command line arguments for a synchronization call as follows:
long rc
string cmd
cmd = myMLSync.GetCommandString()
// Edit cmd however you wish
...
rc = myMLSync.Synchronize(cmd)