home *** CD-ROM | disk | FTP | other *** search
- unit Main;
-
- interface
-
- uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls,
- StdCtrls, DBTables, DB;
-
- type
- TForm1 = class(TForm)
- DatabaseListbox: TListBox;
- TableListbox: TListBox;
- FieldListbox: TListBox;
- IndexListbox: TListBox;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Table: TTable;
- procedure TableListboxClick(Sender: TObject);
- procedure DatabaseListboxClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.TableListboxClick(Sender: TObject);
- begin
- FieldListbox.Clear;
- IndexListbox.Clear;
- Table.DatabaseName := DatabaseListbox.Items[DatabaseListbox.ItemIndex];
- Table.TableName := TableListbox.Items[TableListbox.ItemIndex];
- Table.GetFieldNames(FieldListbox.Items);
- Table.GetIndexNames(IndexListbox.Items);
- end;
-
- procedure TForm1.DatabaseListboxClick(Sender: TObject);
- begin
- TableListbox.Clear;
- FieldListbox.Clear;
- IndexListbox.Clear;
- Session.GetTableNames(DatabaseListbox.Items[DatabaseListbox.ItemIndex],
- '', True, False, TableListbox.Items);
- end;
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- Session.GetDatabaseNames(DatabaseListbox.Items);
- end;
-
- end.
-