uses .., DB, DBTables, DBConsts, DbiTypes, DbiProcs;
function IsLocked(ATable: TTable): boolean;
var
RecordProps: RECProps;
wResult: DBIResult;
begin
Result := True;
with ATable do
begin
if State = dsInactive then DBError(SDataSetClosed);
UpdateCursorPos;
wResult := DbiGetRecord(Handle, dbiWriteLock, nil, @RecordProps);
if wResult = DBIERR_NONE then
begin
DbiRelRecordLock(Handle, False);
Result := False;
end;
end;
end;
--摘自钱达智的笔记