WinCE Database 
Author Message
 WinCE Database


I am trying to create, open, write and read a database in
WinCE. I am able to Create, Open and write but not able to
do a Seek or Read.

I do get a non-zero return value from CeWriteRecordProps()
function. But when I try to Seek or Read, I am getting an
error code of 25 for Seek and 87 for Read. Here is a
sample code below. I would appreciate if anyone can tell
me whats wrong with my code. Just for trying it out, I put
the Seek and Read right after Writing to the database.

Thanks in advance


//Code starts

//For storing user entered values from the dialog box
 rc = DialogBoxParam (hInst, TEXT ("EditAddressbookDlg"),
                         EditAddressBookDlgProc, (LPARAM)
    if (rc == 0)
        return 0;

    // Write the record.
    oid = CeWriteRecordProps(g_hDB, 0, NUM_DB_PROPS,pcepv);
    if (!oid)  {
        rc = GetLastError ();
        wsprintf (szText, TEXT ("Write Rec fail. Error %d
(%x)"), rc, rc);
        MessageBox (hWnd, szText, TEXT ("Error"), MB_OK);
        //Testing Seek and Read

        oid = CeSeekDatabase (g_hDB, CEDB_SEEK_BEGINNING,
1, &dwIndex);
                if (oid == 0) {
                        TCHAR szTxt[64];
                        INT rc = GetLastError();
                        wsprintf (szTxt, TEXT ("Db item
not found. rc = %d (%x)"),rc, rc);
                        MessageBox (NULL, szTxt, TEXT
("err"), MB_OK);

                // Read all properties for the record.

                oid = CeReadRecordProps (g_hDB,
                if (oid == 0) {
                        TCHAR szTxt[64];
                        INT rc = GetLastError();
                        wsprintf (szTxt, TEXT ("Db   item
not read. rc = %d (%x)"),rc, rc);
                        MessageBox (NULL, szTxt, TEXT
("err"), MB_OK);
                                                return 0;

Mon, 27 Dec 2004 22:30:41 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Using ADOCE for WinCE Database

2. Empty WinCE database seems rather large!??

3. How many properties are allowed in WinCE database API?

4. WinCE 3.0 vs. WinCE 4.0 (SDK)

5. How to Backup the Contacts Database、Tasks Database、Appointment Database

6. Error in VC5.0 DATABASE project trying to use a DATABASE DIAGRAM

7. alt.comp.databases,comp.databases,

8. Database/Database Server Blocking.

9. Creating a new database with DAO (Other than Microsoft Jet Database)

10. How do you access remote databases where the database is not registed in the local ODBC

11. Database settings -- Visual C++ used with Visual FoxPro database

12. How to access Custom Database Properties of a Access 97 database programmatically


Powered by phpBB® Forum Software