You can filter messages by remote ID using the dblsn -r option, and the $remote_id action variable.
When synchronizing a SQL Anywhere remote database for the first time, a remote ID file containing the ID of your database is created. The file name is the same as the database, but has the .rid extension, and is stored in the same directory as the database. For UltraLite databases, there is no remote ID file; the remote ID is extracted from the database directly.
When you start the MobiLink Listener, use the dblsn -r option to provide the name and location of the remote ID file or the UltraLite database, then use the dblsn -l option to create your message handler.
You can type the remote ID directly into your message filter. However, remote IDs are GUID by default; the remote ID is not easy to remember unless you provide a meaningful name.
In the dblsn command line, you can specify multiple instances of the -r and -l options. The $remote_id action variable used in a -l option is always specified in the -r option that precedes it. So, it is important to specify the -r option before the -l option.
The following example demonstrates the use of multiple remote IDs. It assumes that your device has a SQL Anywhere database called business.db, and an UltraLite database called personal.udb. In this example, ulpersonal is the window class name of the UltraLite application.
dblsn ... -r "c:\app\db\business.rid" -l "subject=$remote_id;action='dbmlsync.exe -k -c dsn=business';" -r "c:\ulapp\personal.udb" -l "subject=$remote_id;action=post dbas_synchronize to ulpersonal;"
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0|