'AutoInc', 'Blob', 'Memo', 'Graphic', 'FmtMemo',
'ParadoxOle', 'DBaseOle', 'TypedBinary');
var
i, Indx: integer;
Definition: string;
begin
for i := 0 to Table1.FieldCount - 1 do begin
Definition := Table1.Fields[i].DisplayLabel;
Definition := Definition + ' ' +
MyFieldDefs[Table1.Fields[i].DataType];
Table1.IndexDefs.Update;
if Table1.Fields[i].IsIndexField then begin
Indx := Table1.IndexDefs.Indexof(Table1.Fields[i].Name);
if Indx > -1 then
if ixPrimary in Table1.IndexDefs[Indx].Options then
Definition := Definition + ' (Primary)';
end;
Listbox1.Items.Add(Definition);
end;
end;
아래 부분은 파라독스에서 필드정보를 리스트박스에 뿌리는 예제예요.
참고하세요..
procedure TForm1.Button1Click(Sender: TObject);
const
MyFielddefs: array[ftUnknown..ftTypedBinary] of string [11] =
('Unknown', 'String', 'Smallint', 'Integer',
'Word', 'Boolean', 'Float', 'Currency', 'BCD',
'Date', 'Time', 'DateTime', 'Bytes', 'VarBytes',
'AutoInc', 'Blob', 'Memo', 'Graphic', 'FmtMemo',
'ParadoxOle', 'DBaseOle', 'TypedBinary');
var
i, Indx: integer;
Definition: string;
begin
for i := 0 to Table1.FieldCount - 1 do begin
Definition := Table1.Fields[i].DisplayLabel;
Definition := Definition + ' ' +
MyFieldDefs[Table1.Fields[i].DataType];
Table1.IndexDefs.Update;
if Table1.Fields[i].IsIndexField then begin
Indx := Table1.IndexDefs.Indexof(Table1.Fields[i].Name);
if Indx > -1 then
if ixPrimary in Table1.IndexDefs[Indx].Options then
Definition := Definition + ' (Primary)';
end;
Listbox1.Items.Add(Definition);
end;
end;