mobile databases, mobile forms, and mobile synchronization … where you need to work
Providing Pocket Access, Mobile Database, Windows CE Database, and Windows CE Development Solutions

Tip of the Month (March 2007)

Downloading (Publishing) a Table With a Large Number of Records

On occasion, you may need to download a table with a large number of records to the handheld. For example, you may have a PARTS table with 10,000 parts in it. You can use "regular" Visual CE synchronization (using the <--> or --> synchronization operator) to move these records to the handheld, but it may take a bit of time.

Much of this time is used to establish the relationship between the record on the handheld and the record on the desktop. You can save a significant amount of time if don't need this relationship. You don't need this relationship if:

  • The handheld is never used to create new records in the table (or, if a record is created, it is never sent up to the desktop), and
  • The handheld is never used to modify a record in the table (or, if a record is modified, the change is never sent up to the desktop), and
  • The handheld is never used to delete a record in the table (or, if a record is deleted, the corresponding record on the desktop is not deleted).

If you find you don't need this relationship, all you really need to do is "publish" your table. Starting in version 11, Visual CE has a "publish" operator (-->>) you canuse to do this.

If you have an older version of Visual CE (or you don't want to use Visual CE's publish operator), here's an alternative way to publish your data:

  1. Put a few records in the table on the desktop and use Visual CE's FILE | DOWNLOAD TABLE to copy the table to the handheld. When asked if you want to keep the table synchronized, respond NO. When asked if you want to create a form, say YES and download the form to the handheld. For example, if you are downloading the PARTS table, you might call the form PUBLISH_PARTS.VCE.
  2. Run the PUBLISH_PARTS.VCE form on the handheld and select OPTION | EXPORT. This will create a file called PARTS.TXT and this file will be in the same folder are PUBLISH_PARTS.VCE on the handheld.
  3. Using ActiveSync, copy the PARTS.TXT file you created in step (2) to the desktop.
  4. Back in Visual CE's development environment (step (1)), select EDIT | MACRO/EVENTS. Create a new macro called STARTUP. This macro will three steps:
  5. Press the EVENTS button and set the STARTUP event to run the STARTUP macro. Press OK. Press CLOSE.
  6. Download the form to the handheld (FILE | DOWNLOAD FORM).
  7. Look at the file you brought to the desktop in step (3). This will show you the format that Visual CE expects the import file to be in. Create a file formated in this way with all the records you want to be published. Call this file PARTS.TXT.
  8. Using ActiveSync, copy PARTS.TXT to the handheld. Put it in the same folder as PUBLISH_PARTS.VCE.
  9. Start PUBLISH_PARTS.VCE on the handheld. Visual CE will read the part information from the file and put it into the table.