unit Dbutils;
interface
uses
DbTables;
function DbGetVersion(table: TTable): LongInt;
implementation
uses
Db, DbiProcs, DbiTypes, {DbiErrs,}
SysUtils;
function DbGetVersion(table: TTable): LongInt;
var
hCursor : hDBICur;
tableDesc: TBLFullDesc;
cName : array [ 0 .. 255 ] of Char;
begin
StrPCopy(cName, table.TableName);
Check(DbiOpenTableList(table.DBHandle, True, False, cName, hCursor));
Check(DbiGetNextRecord(hCursor, dbiNOLOCK, @tableDesc, nil ));
Result := tableDesc.tblExt.iRestrVersion;
Check(DbiCloseCursor(hCursor));
end ;
end . |