Read data from the CEDB database and make adjustments during Backup

Source: Internet
Author: User

Read the content in cemail, and then back up and restore the content.

Outline:
It mainly describes how to read the CEDB database, back up and restore it! In WinCEProgramDesign this book has a more detailed introduction, and I only have English Electronics

Continue, it seems quite difficult!
1. Open the CEDB Database
2. Read and store the database content
3. Adjust OID

Wince provides a simple database system that supports up to four sort indexes! The most common

It is used to manage information content by cemail. Vol. The CEDB database can store database files in a volume, while the database volume is actually a file

It is easily deleted by users by mistake.
The most basic data of a piece of data is an oId, which establishes a pairing relationship between the data and the data through the oId.
1. Open
The following function is used to assemble the database volume:
Bool cemountdbvol ()
This function can be used to assemble or create a database volume. Here we use open_existing to equip cemail. Vol to get the guid, and then

Perform the following operations. At the same time, we need creatr_always to create another database volume to back up the content of cemail. Vol!
After you use cefindfirstdatabaseex to find the cemail. Vol file handle, you can start preparing to open vol for operations.
The database volume is not opened when the database volume is created. Therefore, you must use the separate function ceopendatabaseex to open the database volume.

2. Read and store
After activating vol, you can start reading data. when reading the data, you can create a data entry in the new database and save the read data to the new database.

In the database
Ceoidgetinfoex returns a struct pointer, which contains a large amount of information about each data object and its parent oid.

It plays an important role in restoration.
After create newdatabace and seekdatabase (similar to file operations), read data to the buffer and back up data.
The functions are
Cereadrecordpro1_x
Cewriterecordprops

3. Adjust OID
It is easy to adjust the OID, but it is complicated. In cemail, several objects are required to store a piece of information,

During restoration, the user's current database already has many OID types. Therefore, you cannot ensure that the oId in the backup file conflicts with the existing oid. Therefore, you must

Create a Data Object first, and modify the content of the data object to match the new oid.

Before adjustment, we can use a tool called dbview to view the oId status in the CEDB database! To determine the part to be adjusted.

Cemail contains the following data volumes, which are associated with oid.

FLDR *****, pmailattachs, pmailfolder, pmailemsgs, pmailoldtables, pmailmsgclasses. pmailnamedprops

Where

Pmailfolders contains information about the system inbox name, such as the folder names under mmsoutlook SMS

Pmailmsg records some sender information, which corresponds to the content sent by the sender (stored in FLDR *****) through the oId

When traversing the database, the above part will be read, and you can flexibly adjust the oId as needed.

I will take the time to describe these steps in detail. Some friends asked meCodeAnd I don't have the right to release the code.

 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.