1
2 unit Unit1;
3
4 interface
5
6 uses
7 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
8 Dialogs, StdCtrls, DB, DBTables,dbierrs;
9
10 type
11 TForm1 = class(TForm)
12 Button1: TButton;
13 Table1: TTable;
14 procedure Button1Click(Sender: TObject);
15 private
16 { Private declarations }
17 public
18 { Public declarations }
19 end;
20
21 var
22 Form1: TForm1;
23
24 implementation
25
26 {$R *.dfm}
27
28 //This code has only been tested on Paradox and Dbase Tables.
29 function GetVersionTable(table: TTable): LongInt;
30 var
31 hCursor : hDBICur;
32 DatosTabla: TBLFullDesc;
33 begin
34 Table.Open;
35 Check(DbiOpenTableList(table.DBHandle, True, False,
36 PChar(Table.TableName), hCursor));
37 Check(DbiGetNextRecord(hCursor, dbiNOLOCK, @DatosTabla, nil));
38 Result := DatosTabla.tblExt.iRestrVersion;
39 Check(DbiCloseCursor(hCursor));
40 table.close;
41 end;
42
43 procedure TForm1.Button1Click(Sender: TObject);
44 begin
45 ShowMessage('Table Version=' +IntToStr(GetVersionTable(Table1)));
46 end;
47
48 end.
49
|