I will try it, thanks for helping !
Nick
Posts
-
How to define sort order in Access and convert to .cdb ? -
How to define sort order in Access and convert to .cdb ?well, I'm using API in eVC: g_hDB = CeOpenDatabaseEx (&g_guidDB, &g_oidDB, _T("book"), 0, /* <- default sort order*/ 0, NULL); I must use "0" for the sort-order since it get an open error if I specify any other value. please advices, thanks.
-
How to define sort order in Access and convert to .cdb ?Thanks for your reply. You're right! The code is fine if I created the DB insided the PPC with the sort order, but it fail when I created the database from Access (officeXP version), and converted to .cdb while copying it to the device. The database has only 3 columns in it: BookID(char 8), Content (char 90), Notes (char 255) Actually I've defined BookID as the unique key index, so how can I define the sort order for it? Even if I type "BookID ASC" in the property page of the Access' db, I get the same result. Is it the ActiveSync's bug that lost the sort order? or where else I shuld define the sort order? If no solution for it, could you suggess any web-site teaching how to install and use SQL CE? expecially how to pack the whole thing including the SQL CE and install together for my client's PPC2002? Please help!
-
How to define sort order in Access and convert to .cdb ?Hi experts, I need to open the .cdb with sort order in API call, but I found that the .cdb converted from .mdb has no sort order, how can I define it in the Access .mdb and would it be lost after the convertion to .cdb? thanks a lot.
-
How to OPEN DB with sort order and SEEK .cdb using API?Dear experts, I cannot seek the DB after mounted and opened the DB, I think it needed to set the sort order before seek but if I set it, the DB cannot be opened, what's wrong in my code? Following is the extract of my code in eVC3.0: //====================begin==================== HANDLE g_hDB = 0; // Handle to database CEOID g_oidDB = 0; // Object ID of the database CEGUID g_guidDB; // Guid for database volume DWORD dwIndex; CEPROPVAL propSeek; // Below is property for the sort order const CEPROPID BookID = MAKELONG (CEVT_LPWSTR, 1); // I can mount the .cdb successfully CeMountDBVol(&g_guidDB, _T("\\test.cdb", OPEN_EXISTING); // I can open the DB if no sort order // but error to open if any sort order exist, why? g_hDB = CeOpenDatabaseEx (&g_guidDB, &g_oidDB, _T("book"), //BookID, //caused runtime error if use "BookID", so I only can use the default '0' here: 0, 0, NULL); //First seek to the start of the database, success for offset value. //The bookID in the first record should be "00001111" CeSeekDatabase(g_hDB, CEDB_SEEK_BEGINNING, 0, &dwIndex); //Seek the record with passed-in parameter //search value below, just a sample and this record does exist propSeek.propid = BookID; propSeek.val.lpwstr = _T("00005555"); //anyway, string value always cannot be seek, only offset success g_oidDB = CeSeekDatabase(g_hDB, CEDB_SEEK_VALUEGREATER, (DWORD)&propSeek, &dwIndex); //then read the record, it done well CEOID ceoidRec; DWORD dwBuf; CEPROPVAL *props = NULL; unsigned short lProps; ceoidRec = CeReadRecordPropsEx(hDB, CEDB_ALLOWREALLOC, &lProps, NULL, (LPBYTE*)&props, &dwBuf, NULL); //try to display the result MessageBox (hWnd, props[0].val.lpwstr , _T("Message"), MB_OK); //======================end==================== What do you think the result? Right! it's "00001111", that means the first record, haven't seek? I created the access ".mdb" file with sample records, field is "BookID" with index that must be unique, from "00001111" to "00009999". And then I copy it to my iPAQ3970 (I've also try with iPAQ3950 as well as the emulator with same result), it converted to "test.cdb" (without synchronization). I have try the VOConnection and VORecordset, it can seek by SQL but very slow where my real database have 30 thousand records and besides the speed, very strange that some records in the middle cannot be seek and read, (about the 15000'th to 20000'th records), I don't know whether it's memory prob