Re: MS Access table and field properties



"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.


.



Relevant Pages

  • Re: How to enter data in a SQL database (SQL Server 2000)?
    ... In vb6 we use ADO to access Database(we can access many kinds of ... to use different provider,connection string. ... Use Bound Controls with an ADO Recordset ... Using ActiveX Data Objects via Visual Basic ...
    (microsoft.public.vb.database)
  • MS Access table and field properties
    ... I'm using D7 and would like to retrieve some field properties using ADO from ... a MS Access database. ...
    (borland.public.delphi.database.ado)
  • retrieve database name from connect string
    ... the application uses a .udl file to connect to an access database. ... I would like to log the database name from the ado connect string. ...
    (borland.public.delphi.database.ado)
  • Re: Send Message to filemaker 5.5 from windows form application
    ... Script created by Steve Carson and it was modified by Kristina ... ' Chrto represent double quotes if you are passing a string. ... Dim pHyperlink As IHyperlink ... 'opens Microsoft Access database ...
    (comp.databases.filemaker)
  • Re: email report per record
    ... is a couple of Access database ... Dim strSubject As String 'Email Subject ... Dim stDocName As String ...
    (microsoft.public.access.reports)