Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Property Database doesn't store all properties

Status
Not open for further replies.

rwbean86

Programmer
Sep 11, 2002
12
0
0
US
I use a property database to store a few simple records. I create records using CeWriteRecordProps and read them back out using CeReadRecordProps. CeReadRecordProps gives me back fewer properties that I'm writing out. Some properties are missing. I see in searching various messageboards that others have had this problem, but nobody has explained how they got past this.


Thanks in advance for your suggestions

Rob

P.S. I will post the exact code here later.
 
I got it working by writing only a few properties at a time.
This example writes 2 records. There ought to be a better way to do it, but this works. Here is the code:



//write a full record to the dispatch database
CEPROPVAL propval[5];
CEOID ceoidRec;

//phone
propval[0].propid = DISPATCHPID_PHONE;
propval[0].val.lpwstr = _T("423-6666");
//address
propval[1].propid = DISPATCHPID_ADDRESS;
propval[1].val.lpwstr = _T("16 apple");
//name
propval[2].propid = DISPATCHPID_NAME;
propval[2].val.lpwstr = _T("mike douglas");
//dispatch id
propval[3].propid = DISPATCHPID_ID;
propval[3].val.lpwstr = _T("new id 222");
//time of arrival
propval[4].propid = DISPATCHPID_ETA;
propval[4].val.lpwstr = _T("05-15");
//write a few recs
ceoidRec = CeWriteRecordProps(hDB,
0, // write new record
5, // number of properties
propval);
//now write the rest
//pickup latitude
propval[0].propid = DISPATCHPID_PICKUPLAT;
propval[0].val.lpwstr = _T("155");
//pickup longitude
propval[1].propid = DISPATCHPID_PICKUPLON;
propval[1].val.lpwstr = _T("255");
//dropoff lat
propval[2].propid = DISPATCHPID_DROPOFFLAT;
propval[2].val.lpwstr = _T("355");
//dropoff lat
propval[3].propid = DISPATCHPID_DROPOFFLON;
propval[3].val.lpwstr = _T("455");
ceoidRec = CeWriteRecordProps(hDB,
ceoidRec, // write new rec
4, // number of properties
propval);
//Write another record
//phone
propval[0].propid = DISPATCHPID_PHONE;
propval[0].val.lpwstr = _T("785-6666");
//address
propval[1].propid = DISPATCHPID_ADDRESS;
propval[1].val.lpwstr = _T("16 pear");
//name
propval[2].propid = DISPATCHPID_NAME;
propval[2].val.lpwstr = _T("maury");
//dispatch id
propval[3].propid = DISPATCHPID_ID;
propval[3].val.lpwstr = _T("nid 000");
ceoidRec = CeWriteRecordProps(hDB,
0, // write new record
4, // number of properties
propval);
//time of arrival
propval[4].propid = DISPATCHPID_ETA;
propval[4].val.lpwstr = _T("20-48");
//pickup latitude
propval[5].propid = DISPATCHPID_PICKUPLAT;
propval[5].val.lpwstr = _T("15");
//pickup longitude
propval[7].propid = DISPATCHPID_PICKUPLON;
propval[7].val.lpwstr = _T("25");
//dropoff lat
propval[8].propid = DISPATCHPID_DROPOFFLAT;
propval[8].val.lpwstr = _T("35");
//dropoff lat
propval[9].propid = DISPATCHPID_DROPOFFLON;
propval[9].val.lpwstr = _T("45");

ceoidRec = CeWriteRecordProps(hDB,
ceoidRec, // write new rec
5, // number of properties
propval);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top