Chapter 16. ADOCE and SQL Server for Windows CEThe use of databases is fundamental to writing most business applications. Chapter 4 (Property Databases and the Registry) showed how to store and retrieve data in the Windows CE property database. While this is very flexible, and entirely adequate for small to medium amounts of data, it does not have the robustness or flexibility of a true relational database such as SQL Server. Further, the API functions and MFC classes are not particularly easy to use when retrieving data from several property databases, as would be the case using a SQL SELECT statement with a join between tables. Windows CE supports a subset of OLEDB, and providers for the Windows CE property database are supplied. ActiveX Data Object (ADO) sits on top of OLEDB and offers a more convenient object model for accessing databases. A subset of the desktop ADO object model, called ADOCE, provides such an interface for Windows CE. Further, the ADOXCE object model allows database objects (such as tables and indexes) to be manipulated. Microsoft has produced a cut-down version of SQL Server 2000 to run on Windows CE, called Microsoft SQL Server 2000 Windows CE edition. This provides the most commonly used functionality in a footprint of around 800 KB. Accessing data in a SQL Server for Windows CE database is significantly faster than in property databases. This chapter shows how to create databases for SQL Server for Windows CE and to manage data in tables using ADOCE and ADOXCE. The same techniques can be applied to manipulate data in property databases.
|