AdsLockRecord

Advantage Client Engine

  This is the first topic This is the last topic  

Attempts to lock the given record

Syntax

UNSIGNED32

AdsLockRecord (ADSHANDLE hTable,

UNSIGNED32 ulRec);

Parameters

hTable (I)

Handle of table or cursor.

ulRec (I)

Record number to lock.

Special Return Codes

AE_LOCK_FAILED

The attempted lock failed. The lock may be held by another user.

AE_TABLE_NOT_SHARED

A lock was attempted on a table opened exclusively.

Remarks

A record lock allows a user to update a shared file. If the table is already file locked or opened exclusively, this function returns AE_SUCCESS. If a record lock is successful, the record is reread. If zero is sent from ulRec, the current record is locked. If the record number sent to this function is the number of records in the table + 1, no other users will be able to append records to the table.

Note AdsLockRecord does not perform multiple attempts to lock the record if the lock fails.

Example

Click Here

See Also

AdsOpenTable

AdsLockTable

AdsUnlockRecord

AdsIsRecordLocked

AdsGetAllLocks