Just a guess here, but I would suspect that you have a perfectly valid (non-deleted) record in your database without any handle associated with it (i.e., with a NULL handle). How can this happen, I hear you ask? Simple -- Just use DmAttachRecord with a NULL new handle! There **may** be other ways to get into this state, but that is the only one I found.
You might experiment with DmResizeRecord() with a zero size, but I think you will still have a handle, it just won't have any data in it! DmNewRecord and DmNewHandle, if passed a zero size, will both fail. -bob mckenzie, palm portland -----Original Message----- From: scott [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 4:07 PM To: Palm Developer Forum Subject: DmGetRecord failing What could cause DmGetRecord to return NULL, but also cause DmGetLastErr to return 0? It is my understanding that DmGetLastErr should help me figure out why DmGetRecord fails. Here is essentially my code: Err wish_modify_wish(UInt16 *record_num, WishFieldsType field_type, void *data) { Err err = errNone; MemHandle h; Char errbuffer[128]; h = DmGetRecord(_wish_db, *record_num); if (!h) { Err err = DmGetLastErr(); StrPrintF(errbuffer, "Error %d Record %d", err, *record_num); ErrDisplay(errbuffer); ErrDisplay("Failed to get record"); return err; } /*SNIP*/ return err; } _wish_db is a valid pointer through which I can later get other records from the database during the same debugging session. And record_num points to the value '0', which should be a valid index for a database with 66 records. I am running on Pose 3.3 with the 3.0 debug rom and the error occurs about 350,000 events into a gremlin run, so it isn't frequent. scott -- ------------------------------------------------------------------------ scott [EMAIL PROTECTED] ------------------------------------------------------------------------ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
