On Thu, Feb 07, 2002 at 02:20:23AM +0000, Benjamin Brazil wrote:
> 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.
> 
> 

How are you verifing that the record is not deleted?  By the number of
records in the database?  DmDeleteRecord does not decrease this count.
DmDeleteRecord simply deletes the record's data, but leaves the record
entry intact so that it it can be reconciled during the next hotsync.
DmRemoveRecord totally removes a record.  And DmDeleteRecord is typically
followed by a DmMoveRecord to put the deleted record at the end of the
database.  Search the sample code for how DmDeleteRecord is used in apps
like memopad and todo.

API for DmDeleteRecord:
http://www.palmos.com/dev/support/docs/palmos/DataAndResourceManager.html#939238


API for DmRemoveRecord:
http://www.palmos.com/dev/support/docs/palmos/DataAndResourceManager.html#940804

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/

Reply via email to