Common CE database questions

Q: Is it possible to use the CEDB APIs (CeMountDBVol, CeOpenDatabaseEx, etc) to open an existing database (.cdb file), and then read records from it? Or must I use ADOCE?

A: If the database was created using ADOCE, then you should use ADOCE to access it. The CEDB APIs *can* be used to access the database, but the problem is that ADOCE stores additional "meta-data" in the database that you may mess up by doing it that way. Accessing ADOCE databases via the CEDB APIs just breaks an abstraction barrier that might cause you problems.  If the database was not created using ADOCE, then you cannot use ADOCE to access it, because it will be lacking the meta-data that ADOCE needs.  [I wish Microsoft had set forth a convention whereby you could tell the difference between ADOCE CEDB databases and normal CEDB databases.  Alas, everyone started copying the ADOCE convention of using a “.cdb“ extension.]

Q: Can I really access ADOCE databases from eVC++? The documentation is really lacking and the sample code is confusing.

A: I wish I could help you with your problems using ADOCE, but really my expertise is in the CEDB APIs, not the ADOCE layer wrapped on top of them.  (Sometimes I can make educated guesses about what the ADOCE layer is doing.)  It does seem that a lot less consideration was given to C++ users than VB users when it comes to the ADOCE support and documentation. I do suggest posting questions on newsgroups like microsoft.public.windowsce.app.development or microsoft.public.windowsce.embedded.vc. There are a few knowledgeable newsgroup users out there who answer database questions.

Q: How do I use ADOCE 3.1 with CE 4.x / PocketPC 2003? I can't even seem to install it.

A: ADOCE only supports CE 3.0 and earlier, which corresponds to PocketPC and PocketPC 2002.  Older ADOCE applications developed for earlier operating systems should still run on the newer OS, but you cannot use those tools to develop applications for the newer OS.  For CE 4.x and PocketPC 2003, my understanding is that you need to use ADO .NET with Visual Studio .NET 2003.  And make sure to read the next Q/A.

Q: When I use ADO .NET to build database applications for CE 4.x / PocketPC 2003, how do I create a CEDB database? It only seems to let me use SQL-CE.

A: You can't.  They (ADO) dropped support for CEDB.  :-(  This means, your only choice for developing ADO applications that use CEDB is to develop using the CE 3.0 / PocketPC / PocketPC 2002 tools (eg. eVC 3.0) with ADOCE.  Your application should work on newer OS versions but you have to use the old tools.  Probably you are just best off switching to SQL-CE.