Delphi Examples: DbiOpenFieldTypesList

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Delphi Examples: DbiOpenFieldTypesList

Return to chapter overview

Obtain field types for the driver and append the information to the TStringList passed in.

This example uses the following input:

 fDbiOpenFieldTypesList(TmpList, szParadox, 'PDOX 7.0');

 

The procedure is:

procedure fDbiOpenFieldTypesList(FieldTypeList: TStringList; DrvType, TblType: string);

var

 TmpCursor: hDbiCur;

 FieldType: FLDType;

 result: dbiResult;

begin

 Check(DbiOpenFieldTypesList(PChar(DrvType), PChar(TblType), TmpCursor));

 FieldTypeList.Clear;

repeat

   result:= DbiGetNextRecord(TmpCursor, dbiNOLOCK, @FieldType, nil);

  if (result <> DBIERR_EOF) then begin

     FieldTypeList.Add('Field Name: ' + FieldType.szName);

  end;

until (Result <> DBIERR_NONE);

 Check(DbiCloseCursor(TmpCursor));

end;