Previously, wm5 systems generally used CEDB databases, and EDB is one of the new features in wm5. To improve applicationsProgramCEDB has been replaced by EDB because of its performance and long-term portability. EDB utilizes the storage subsystem used by SQL mobile and provides performance significantly better than CEDB (especially when used together with persistent storage ). Because CEDB provides the same function set as EDB, all functions have the same name and parameter list. However, EDB also contains functions not included in CEDB, And the creation method is different, which is more complex than CEDB. The following describes how to create and use EDB:
I. Create:
1. Cemountdbvol (); // create a volume
2. Cecreatedatabasewithprops (); // create an EDB instance after the volume is created successfully.
3. Cecreatesession (); // creates a session after EDB is created successfully to enable EDB.
4. Ceopendatabaseinsession (); // open EDB
You must create a cedbaseinfoex object before creating EDB. This object is used to create info in EDB and set EDB.
You must maintain a global handle when enabling it. It will be used in future operations.
II. Select data
1. Ceseekdatabaseex (); // locate the data
2. Cereadrecordpropsex (); // read the data to be located.
Create a cepropval object and pass the conditions of the data to be located to this structure.
3. Insert data
Cewriterecordprops (); // write data to EDB
Create a cepropval object or an array of objects to pass the data.
4. Delete data
1. Ceseekdatabaseex (); // locate the data to be deleted
2. Cedeleterecord (); // Delete the data to be located
5. Update Data
The inserted data is basically the same, that is, overwrite existing data.
1. Ceseekdatabaseex (); // locate the data
2. Cewriterecordprops (); // write new data to EDB to overwrite the original data
Sat. Disable EDB
Closehandle (handle when opening );
The key here is the parameter selected when EDB is created and the use of the struct so that data can be correctly located. Otherwise, selection, update, and deletion cannot be achieved.