function TBDEDirect.GetCurRecord(Lock: DBILockType): PChar;
var
Res: DBIResult;
RecSize: Word;
RecBuf: PChar;
Bookmark: TBookmark;
begin
Result := StrNew('');
if CheckDatabase then
begin
RecSize := GetPhysicalRecSize;
RecBuf := StrAlloc(RecSize+1);
FillChar(RecBuf^, RecSize+1, #0);
Bookmark := FDataLink.DataSource.DataSet.GetBookmark;
DbiSetToBookmark(FDataLink.DataSource.DataSet.Handle, Bookmark);
FDataLink.DataSource.DataSet.FreeBookmark(Bookmark);
Res := DbiGetRecord(FDataLink.DataSource.DataSet.Handle, Lock, RecBuf, nil);
if Res = 0 then
Result := RecBuf
else
Check(Res);
end;
end;
|