Sorry that I haven't quite got it yet.
>From my understanding this code should work:
DatabaseHandle=DmOpenDatabaseByTypeCreator('DATA', 'PS02', dmModeWrite);
if (DatabaseHandle !=0)
{
DmDeleteRecord(DatabaseHandle, 0);
DmCloseDatabase(DatabaseHandle);
}
>From what I understand, the database PS02 successfully opens and returns a
handle to my database. No error occured, therefore DatabaseHandle does not
hold the value 0. The code then should go through the if statement, as
DatabaseHandle is not equal to 0. Then the record at index 0 of the database
should be deleted. The database then closes.
I am obviously missing something as the record is not deleted.
Thanks again,
Benjamin Brazil.
>--- Benjamin Brazil wrote:
> > I am trying to delete a database record using the following code:
> >
> > DatabaseHandle=DmOpenDatabaseByTypeCreator('DATA', 'PS02',
> > dmModeWrite);
>
>Insert:
> if (DatabaseHandle != 0)
>
>Otherwise, how do you know the database is open?
>
> > DmDeleteRecord(DatabaseHandle, 1);
>
>Instead, try:
> err = DmDeleteRecord(DatabaseHandle, 0);
> if (err != errNone)
> // check if it was dmErrIndexOutOfRange, dmErrRecordArchived,
> // dmErrRecordDeleted, or memErrInvalidParam...
>
>I believe the first record is at index 0, not 1.
>
>
>__________________________________________________
>Do You Yahoo!?
>Send FREE Valentine eCards with Yahoo! Greetings!
>http://greetings.yahoo.com
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
>please see http://www.palmos.com/dev/tech/support/forums/
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/