4. Property Databases and the Registry

< BACK  NEXT >
[oR]

Chapter 4. Property Databases and the Registry

Property databases in Windows CE allow your applications to store structured data in records. The data is stored in properties, which are also called "fields" or "items." Each property has a defined data type, such as "two-byte integer", "character string", and so on. The major difference between Windows CE property databases and more traditional databases on desktop or server PCs is that records in a database can have varying numbers of properties.

Property databases are located in the Object Store in the "database" folder. You will find standard databases in this directory, such as "Appointments Database," "Contacts Database," and "Tasks Database," together with databases created by your own applications. Since Windows CE 2.10, databases can also be placed in storage cards using database volumes. Database volumes are files with a CDB extension.

Each property database has a unique Object ID (OID) (just like files and directories) in the object store. Records in property databases also have OIDs, since they are object store items in their own right. Each property in a record is given an integer identifier by the programmer that is unique within the record but may also be used by properties in other records to indicate instances of the same property. Data stored in property databases is, by default, compressed.

The Win32 API allows you complete control over property databases, including creating, opening, and accessing of data, and creation of up to four sort orders (indexes) to speed up searching and retrieval. Analogous Remote API (RAPI) functions allow you to access a device's property databases from a desktop PC (see Chapter 10).

Property databases are available on most implementations of Windows CE and are generally the first choice for storing structured data that can be organized into properties and records. Property databases can be as large as the available free space. Each property can be up to CEDB_MAXPROPDATASIZE (65,471) bytes. The maximum record size is only limited by the amount of space used by the property database for logging (which implements transactions to allow roll-back in the event of failure). This value, CEDB_MAXRECORDSIZE, is set at 131,072 bytes.

Data is central to most applications. The data should be placed in a database whenever it can be sensibly structured into fields and records. The possibilities are:

  • Creating a simple property database to store data locally on a Windows CE device

  • Opening and reading standard databases, such as the contacts database

  • Sharing data between desktop databases and CE property/CDB databases, perhaps with automatic synchronization of data

  • Manipulating property databases on a Windows CE device directly from a desktop PC using the Remote API (RAPI, see Chapter 10)

While property databases are used to store structured, or semi-structured, data, the registry is used to store small amounts of application-specific data, such as settings or preferences. This chapter looks at accessing data items in the registry. The registry is included in this chapter since, just like property databases, it is an integral part of the object store. The registry is not stored in a file, as is the case with Windows NT/98/2000.


< BACK  NEXT >


Windows CE 3. 0 Application Programming
Windows CE 3.0: Application Programming (Prentice Hall Series on Microsoft Technologies)
ISBN: 0130255920
EAN: 2147483647
Year: 2002
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net