Creating a Database (Windows Embedded CE 6.0)
1/6/2010
Use the CeCreateDatabaseEx (CEDB) function to create a database in any volume. CeCreateDatabaseEx identifies the volume, names the database, identifies the sort order, and accepts a user-defined type identifier. The sort order is an index that is applied to a database to manipulate the sort order. It is defined when the database is created, but can be altered later. The type identifier is user-defined and is commonly used to identify similar types of databases.
To create a database in the object store
Use the CREATE_SYSTEMGUID macro to create a global identifier for the object store.
The returned GUID identifies the object store.
Call CeCreateDatabaseEx, using the CEGUID that was created with CREATE_SYSTEMGUID.
When you create a database on a mounted volume, it is usually preferable to make the database uncompressed. Accessing a mounted volume is usually slower than accessing the object store. Compressing and decompressing slows the process even further. Therefore, create your database as an uncompressed database, unless you expect the database to be larger than the storage card can contain.
Changing the compression setting for an existing database does not affect existing records. Only new and modified records are stored at the new compression setting.
To set compression on a database after the database is created
Create a CEDBASEINFO (CEDB) structure with the dwFlags member set to CEDB_VALIDBFLAGS.
Turn off the CEDB_NOCOMPRESS extended flag in the dwFlags member as shown in the following example:
dwFlags &= ~(CEDB_NOCOMPRESS);
Call the CeSetDatabaseInfoEx (CEDB) function with this CEDBASEINFO structure.