Use the CeCreateDatabaseEx function to create a database in any volume. CeCreateDatabaseEx identifies the volume, names the database, identifies the sort order, and lets you pass in a user-defined type identifier. The sort order is an index that is applied to a database to manipulate the record ordering. Although you define the sort order when the database is created, you can alter the sort order later. The type identifier, while user-defined, is commonly used to identify similar types of databases.
The returned GUID can act as a standard identifier for a handle.
When you create a database on a mounted volume, it is usually a good idea 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.
dwFlags &= ~(CEDB_NOCOMPRESS);