db_append
Previous Topic  Next Topic 

Synopsis:

       rec_handle=db_append(db_handle)


Arguments:

       db_handle - Database handle returned from db_open()


Description:   This function appends a blank record to the given DBF file specified by db_handle.      Note that the append byte for the DBF file will be locked and a blank entry will be added to any indexes associated with the DBF file and that have been opened using the db_ixopen() function.


After appending the record then a handle to the internal representation of the record will be returned.      If there is already another task that has call db_append() on this DBF file but has not yet released the record with db_rls() then the function will fail with a locking error.



To release the record and write any changes made to the internal record representation made with db_fput() then and to remove the lock on the append byte then the db_rls() (or db_rlsall()) function should be called.  


The record will also be released (and the lock removed) if the DBF file is explicitly closed through a call to db_close() or db_closeall() or if the task is killed through a call to task_kill() or task_chain() or if a stop or restart statement is encountered.


Returns:  Returns the record handle or a negative error code.