Skip to Main Content
Palm OS Programming, 2nd Edition
book

Palm OS Programming, 2nd Edition

by Julie McKeehan, Neil Rhodes
October 2001
Intermediate to advanced content levelIntermediate to advanced
704 pages
19h 33m
English
O'Reilly Media, Inc.
Content preview from Palm OS Programming, 2nd Edition

Moving Data to the Desktop

When you 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 step-by-step process, starting with the choices you have in how you read through the records.

Finding the Number of Records

SyncGetDBRecordCount finds the number of records in a database:

long SyncGetDBRecordCount(BYTE fHandle, WORD &rNumRecs);

Call it with:

WORD numRecords;
err = SyncGetDBRecordCount(rHandle, numRecords);

Reading Records

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.

Iterating through each record, stopping only for altered ones

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.

Looking up exact records via unique record ID

Sometimes you ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Palm OS Network Programming

Palm OS Network Programming

Greg Winton
Palm Programming: The Developer's Guide

Palm Programming: The Developer's Guide

Neil Rhodes, Julie McKeehan

Publisher Resources

ISBN: 1565928563Errata Page