L
lnboy
Unregistered / Unconfirmed
GUEST, unregistred user!
用ADO吧,很简单的:
procedure TForm1.DataSetBtnClick(Sender: TObject);
begin
ADOConnection1.Close;
ADOConnection1.ConnectionString:= PromptDataSource(Handle, ADOConnection1.ConnectionString);
//在这里你可以随便配置数据源了,不只是Access.
label1.caption := ADOConnection1.ConnectionString;
end;
procedure TForm1.GetTableNameBtnClick(Sender: TObject);
begin
ADOConnection1.GetTableNames(ListBox1.Items);
//这里是获取连接到的数据库里的表名
end;
procedure TForm1.DataSetBtnClick(Sender: TObject);
begin
ADOConnection1.Close;
ADOConnection1.ConnectionString:= PromptDataSource(Handle, ADOConnection1.ConnectionString);
//在这里你可以随便配置数据源了,不只是Access.
label1.caption := ADOConnection1.ConnectionString;
end;
procedure TForm1.GetTableNameBtnClick(Sender: TObject);
begin
ADOConnection1.GetTableNames(ListBox1.Items);
//这里是获取连接到的数据库里的表名
end;