Tip of the Month (June 2002)
Changing the Database Used by a Form
The Windows CE operating system provides three separate record storage systems. There is the Windows CE Database Object Store, Pocket Access Databases (.CDB files), and SQL Server CE Databases (.SDF files). Visual CE's FILE | CREATE TABLE and FILE | DOWNLOAD TABLE create tables in the Windows CE Store. When you drag an .MDB file to the handheld, the ActiveSync synchronizer converts the file to a Pocket Access database. SQL Server CE can beused to create a .SDF file.
All the tables used by any given Visual CE form reside in the Windows CE Store, a single Pocket Access database, or a single SQL Server CE database. This choice is made when the form is first created. On occasion, you might want to change the SQL Server CE database a form uses, convert it to use the Windows CE Store, etc.
Unfortunately, you just can't change the underlying database. You will have to rebuild the form. But, here's a tip to make it easier: Bring up Visual CE on your desktop computer (START | PROGRAMS | VISUAL CE | VISUAL CE) and load in the orignal form. Leaving that instance of Visual CE up, start up Visual CE again (START | PROGRAMS | VISUAL CE | VISUAL CE) and build the new form in the second Visual CE instance. You will be able to cut and paste controls between the two forms.