1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37:
| uses BDE;
type TFelderListe = class(TDBDataSet) private FTableName: string; protected function CreateHandle: HDBICur; override; function GetRecordCount: LongInt; override; public property TableName: string read FTableName write FTableName; end;
{ TFelderListe }
function TFelderListe.CreateHandle: HDBICur; var STableName : array[0..255] of Char; begin AnsiToNative(DBLocale, FTableName, STableName, SizeOf(STableName)); Check(DbiOpenFieldList(DBHandle, STableName, nil, false, result)); end;
function TFelderListe.GetRecordCount: LongInt; begin check(dbiGetRecordCount(handle, result)); end;
procedure TForm1.FormCreate(Sender: TObject); var fl : TFelderListe; begin fl := TFelderListe.Create(self); fl.TableName := 'xxx.dbf'; fl.Active := true; DataSource1.DataSet := FL; end; |