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 2005)

Backing Up Your Data

If you created a table using Visual CE's FILE | CREATE TABLE or FILE DOWNLOAD TABLE, the table is created in the RAM memory of the device. If the device loses power, the RAM memory would be lost and so your data would be lost. It is a good idea to periodically backup the data in the table.

One way to create a backup is to use Visual CE's Export. Selecting the menu item OPTION | EXPORT will create am export file in the same folder as the .VCE file. If you put the .VCE file on the storage card, then the export file will be on the storage card. Alternatively, you can use a Command Button with the action OPTION | EXPORT and specify the pathname of a file (presumably on the storage card).

When it comes time to restore the data, you would select OPTION | IMPORT. Alternatively, you can use a Command Button with the action OPTION | IMPORT and specify the pathname of the file you previously created during the export (presumably on the storage card).

This works pretty well, but it has some drawbacks: It only exports fields that have controls associated with them, the Pictures (scribbles) are not preserved, and the indexes are not created.

Another alternative is using the Backup utility that can be found in the Free Downloads section of http://www.syware.com. It is one of the Visual CE Add-On tools. This is an interactive utility that lets you select which table you want to back up and what file you want to back it up to. To run the utility, select START | PROGRAMS | VISUAL CE TOOLS and select "Backup", click the "Backup" radio button, select the table you want to backup, pick the backup file, and press the OK button. If you backup to a file on the storage card, the data will be secure. All the columns (including the Pictures (scribbles)) are backed up and the index information is saved.

When it comes time to restore the data, you can run the same utility again and select the "Load" radio button, pick the backup file, and press to OK button. The data and the indexes are recreated.

It is possible to create a Command Button on your form that can be used to initiate a Visual CE Tools Backup or Load. Select the "Run External" action, set the Command to the the Visual CE Tools (on the handheld, usually \Program Files\Visual CE Tools\ViceTool.exe). The Arg value determines whether you are doing a Backup or a Load and the parameters needed:

  • To do a backup: The format of the Arg string is (note that the table name must be enclosed in double quotes and the dump file pathname is not):

    /d "My Table" \Storage Card\My Dump File.ced

  • To load a previously dumped file: The format of the Arg string is (note that the dump file pathname is not enclosed in double quotes):

    /l \Storage Card\My Dump File.ced

Note: The Backup utility can also be run the on the desktop (START | PROGRAMS | VISUAL CE | VISUAL CE TOOLS) when the handheld is attached. It reads/writes data on the handheld and writes/reads a file on the desktop.