PCEGUID pceguid,
LPWSTR lpszDBVol,
DWORD dwFlags ); Now that you have an open volume, you create a database: CEOID CeCreateDatabaseEx(PCEGUID pceguid, CEDBASEINFO *
lpCEDBInfo ); CeCreateDatabaseEx takes the guid from the above function, along with the name of the database, and creates a database in that volume. As shown in Figure F, our database volume is called \CEDB.clb. Volumes located on file systems have the default extension of CLB and are simply hidden files. Figure F

Database volume The database, named CEDB, has only one volume. After creating the database, you still need to open it. The following code snippet opens the database: HANDLE CeOpenDatabaseEx( PCEGUID pceguid,
PCEOID poid,
LPWSTR lpszName,
CEPROPID propid,
DWORD dwFlags,
CENOTIFYREQUEST *pRequest hwndNotify ); Windows CE does support the ability to have multiple threads accessing the same database, although you have to manage all the synchronisation. The CENOTIFYREQUEST tells you of database changes in an asynchronous manner via a callback function. After opening the database, the best thing to do is seek to the beginning of the database to prepare for a sequential read, as outlined in this code: CEOID CeSeekDatabase(
HANDLE hDatabase,
DWORD dwSeekType,
DWORD dwValue,
LPDWORD lpdwIndex );
You might notice that many of the functions have an association with a CEOID type. A CEOID is an object identifier to the database. You can search for records based on value, as well as the CEOID, a unique ID for each individual record contained in a given database. Think of it as a pointer to the record. The CeSeekDatabase function allows you to seek from the beginning, the end, and the current location of the database. You can also seek based on a certain value of a certain field of the record. The Database API doesn't support Structured Querying Language (SQL), which allows you to conduct searches based on specific search strings. Consequently, the Database API had to create a method for the developer to navigate through the records manually via the CeSeekDatabase function.






