As I have promised before, I will write how to compile the sample. Since there is no ADO support for EVC 4.0 in SQL CE 2.0, we must use OLEDB.
If you try compile the sample, for sure, it won't be compiled well. Many errors will be raised. So this is the step how to compile it. Btw, I got these steps from this link
1. It seems that the dll and header oledb included in the default installation doesn't work well. So download the newest one from this link
2. After that, add this line into your stdafx.h : '#include <ssceoledb.h>'
3. Still in the same file, comment these lines:
///#define OLEDBVER 0x210
//#define DBINITCONSTANTS
//#define INITGUID
//#include <oledb.h>
I think these lines will be declared at the new header ssceoledb (SQL Server CE for OLEDB)
4. Make sure you include these library in the Object/Library modules:
"commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib Ole32.lib Oleaut32.lib Uuid.lib"
5. Since this OLEDB COM threading type is FreeThreaded or MultiThreaded, so don't forget to add this line before you call the API
"CoInitializeEx(NULL, COINIT_MULTITHREADED)"
Finally, try to compile it and run on your emulator. Don't forget to install the SQLCE first on the emulator. I have made a simple CAB installer for it, so that you don't have to install it manually. You can mail me at arnoldw.id(at)gmail(dot)com if you are interested to have it. After everything is downloaded into the emulator, run the northwind database. If there is no problem, you will see a dialog box describing each employee of the northwind company. Nice software since it teaches how to store picture in the database too.

For the next, my post will focus on how to make a simple OLEDB code.