When you need to send data from the handheld to the desktop you have to read through the records of the remote database and translate them into appropriate structures on the desktop. Here is the process, a step at a time, starting with the choices you have in how you read through the records.
SyncGetDBRecordCount finds the number of records in a database:
long SycnGetDBRecordCount(BYTE fHandle, WORD &rNumRecs);
Call it with:
WORD numRecords; err = SyncGetDBRecordCount(rHandle, numRecords);
You can read records in a remote database using any of the following strategies:
Iterate through each record, locating the next altered record
Look up exact records via unique record ID
Read the nth record in the database
We employ the last strategy for reading the records from our Sales order databases and the first strategy when we fully synchronize our customer list. There are a few points worth mentioning about each strategy.
If you want to iterate through the records and stop only on the ones that have been modified, use SyncReadNextModifiedRec . It retrieves a record from the remote database if the dirty bit in the record has been set.
A variation of this routine is SyncReadNextModifiedRecInCategory , which also filters based on the record’s category. This function takes the category index as an additional parameter.