tsession组件的GetTableNames方法,具体请看帮助.
我做的小例子,已运行ok
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, ADODB, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
ComboBox1: TComboBox;
Session1: TSession;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
MyStringList : tstrings;
begin
MyStringList := TStringList.Create;
try
Session.GetTableNames('DBDEMOS', '*.db',False, false, MyStringList);
ComboBox1.Items := MyStringList;
ComboBox1.ItemIndex:= 0;
finally
MyStringList.Free;
end;
end;
end.