2005. április 9., szombat

How to get a list of all table names in a database


Problem/Question/Abstract:

How does one get a list of the table names in a database? The TDatabase.Datasets list seems to be only open tables. I need to get at the unopened ones as well.

Answer:

procedure TForm1.Button1Click(Sender: TObject);
var
  ts: TStringlist;
begin
  ts := TStringlist.create;
  Session.GetTableNames('DBDEMOS', '*.DB', false, false, ts);
  listbox1.items.assign(ts);
  ts.free;
end;

Nincsenek megjegyzések:

Megjegyzés küldése