Re: MS Access table and field properties
- From: "Alfred ten Hoeve" <Alfred@xxxxxxxxx>
- Date: Sun, 28 Aug 2005 03:14:16 +0200
"TMA" <tmasoftwares@xxxxxxxxx> schreef in bericht
news:4310ac19@xxxxxxxxxxxxxxxxxxxxxxxxx
> I'm using D7 and would like to retrieve some field properties using ADO
> from a MS Access database. I need to know for each given table name the
> list with field names, and in each field, it's type (number, string, etc),
> it's maximum size and the comments i write on MS Access main program.
> Help with some source code would be appreciated.
> Thanks in advance.
Something like this:
procedure TForm1.GetIt;
var
i : integer;
s : string;
l : integer;
begin
ADODataSet1.GetFieldNames(ListBox1.Items);
for i := 0 to ADODataSet1.FieldCount - 1 do
begin
case ADODataSet1.Fields[i].DataType of
ftUnknown : s := 'Unknown';
ftString : s := 'String';
ftSmallint : s := 'SmallInt';
ftInteger : s := 'Integer';
ftFixedChar : s := 'FixedChar';
ftWideString : s := 'WideString';
// etc
end;
ListBox2.Items.Add(s);
l := ADODataSet1.Fields[i].Size;
ListBox3.Items.Add(IntToStr(l));
end;
end;
Alfred.
.
- Follow-Ups:
- Re: MS Access table and field properties
- From: TMA
- Re: MS Access table and field properties
- References:
- MS Access table and field properties
- From: TMA
- MS Access table and field properties
- Prev by Date: Re: Question about Requery
- Next by Date: Re: ADO Question
- Previous by thread: MS Access table and field properties
- Next by thread: Re: MS Access table and field properties
- Index(es):
Relevant Pages
|