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


Recovering from Loss of Power

When the power gets low on your handheld, your device will turn off and you will not be able to turn it back on. This does not neccessarily mean you have lost everything on the handheld. The Windows CE operating system detects this low power situation and goes into a "hibernation" state to try to preserve memory for as long as possible. Generally, if you recharge your device in time, you will not have lost anything.

Of course, if you ignore the device long enough, the power will eventually run out. Everything on the storage card will be preserved, but you will lose everything in RAM memory.

As far as Visual CE is concerned, there are three things that you would need to restore in the event of a complete power loss: (1) the Visual CE runtime system, (2) the data, and (3) the forms.

Restoring the Visual CE Runtime System
In order for a form to run, the Visual CE Runtime System has to be installed on the device. When you first installed Visual CE development software on the desktop, we installed this on the handheld. If you have a Professional Edition or MobileSuite the redistributable installer installs the Visual CE Runtime System on your end user's handheld. The Visual CE Runtime System consists of some files and some registry entries, all of which must be in the proper place in order to run your forms.

You can restore the Visual CE Runtime System by simply connecting your handheld to your dekstop and reinstalling Visual CE on the desktop (just install right on top of your current installation, don't uninstall first).

If you need to recover without the use of a desktop machine and you have a Pro or Enterpise Edition, we provide .CAB files that contain the Visual CE Runtime System for the different processors (most people have an ARM processor). They can be found in C:\Programs Files\Windows CE Services\SYWARE Visual CE\VICERT.*.CAB (please note that the VICERT.*.CAB files are redistributable, but the VCE.*.CAB files are not). You can put the appropriate .CAB file on your storage card and, in the event of power loss, you can run the .CAB file to reinstall the Visual CE runtime system. But, the Windows CE operating system has a funny quirk: after a .CAB file runs, it deletes itself. So, we suggest that, if you are going to run the .CAB file, first make a copy and then run the copy. That way, if you lose power again, you'll still have a .CAB file you can use to reinstall.

Restoring the Data
Visual CE tables (tables you created using Visual CE's FILE | CREATE TABLE and FILE | DOWNLOAD TABLE) are in RAM memory, so they would be lost if the power is lost. Last month's tip of the month talks about how to backup and restore tables. If you need to recover without the use of a desktop machine, we provide .CAB files that contain the Visual CE Tools for the different processors (most people have an ARM processor). They can be found in C:\Programs Files\Windows CE Services\SYWARE Visual CE\VT.*.CAB. You can put the appropriate .CAB file on your storage card and, in the event of power loss, you can run the .CAB file to reinstall the Visual CE Tools. But, the Windows CE operating system has a funny quirk: after a .CAB file runs, it deletes itself. So, we suggest that, if you are going to run the .CAB file, first make a copy and then run the copy. That way, if you lose power again, you'll still have a .CAB file you can use to reinstall.

Restoring the Forms
Of course, your tables don't do you much good unless you have a Visual CE appplication to read/write them. If you keep backup copies of the .VCE files on the storage card also, you can restore these files by using the file explorer and copying and pasting them back to where they are supposed to be. Or, better yet, when you download your forms to the handheld while designing your Visual CE application, put the forms on the storage card. That way they won't be lost if the power is lost.