How to get table's structure info?

Hi, expert:

I know there is a way that can be  get table's  stucture info within
program. I look for online help , I couldn't find out it .
PLS, Give me a hint. thanks.

Venne

VenneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JoeBoothCommented:
The simplest way is to loop through the fields property associated with the table.

for x := 0 to theTable.fields.count-1 do
begin
   //
   // Get the field
   theField := theTable.fields[x];
   // Only look at fields from table
   if theField.fieldKind = fkData
   then
     begin
        // Some field properties
        // of interest
   fieldname - name of field from table
   datatype - type of data
   datasize - size of data

     end;
end;
0
PeterLarsenCommented:
Hi Venne,

I think this is what you'r looking for !!

procedure TDbModul.findtabelPropety(FundetTabledata : Tstringlist);
var
  TabelPropety : CURProps;
begin
  Check(DbiGetCursorProps(Table1.handle, TabelPropety));
  with FundetTableData do
  begin
    Add('Table Name: ' + TabelPropety.szName);
    Add('Table Type: ' + TabelPropety.szTableType);
    Add('Fields: ' + IntToStr(TabelPropety.iFields));
    Add('Record Buffer Size: ' + IntToStr(TabelPropety.iRecBufSize));
    Add('Indexes: ' + IntToStr(TabelPropety.iIndexes));
    Add('Validity Checks: ' + IntToStr(TabelPropety.iValChecks));

    Add('Referential Integ Checks: ' + IntToStr(TabelPropety.iRefIntChecks));
    Add('Table Level: ' + IntToStr(TabelPropety.iTblLevel));
    Add('Language Driver: ' + TabelPropety.szLangDriver);
   if TabelPropety.bProtected=true then
    add('Password protected')
    else
    add('NOT Password protected')
  end;
end;


Regards
Peter
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PeterLarsenCommented:
You may find the information in the helpfile : "Borland Database Engine online Reference".
Search for "CURProps"

/PL
0
VenneAuthor Commented:
Though, your anwser is not I wanted, but it help me find out what I wanted. so I will give you points.
Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.