请大家帮忙,用tadodataset访问access数据库,连接已建立,如和操作才能在tcombobox的下拉列表中显示access数据库中的所有表名。
连接代码如下:
DataNewS.LinkLocal.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;'+
'Data Source='+Trim(Edit1.text+';'+
'Persist Security Info=False';
DataNewS.LinkLocal.CommandType:=cmdTable;
请大家帮忙,谢谢!!
连接代码如下:
DataNewS.LinkLocal.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;'+
'Data Source='+Trim(Edit1.text+';'+
'Persist Security Info=False';
DataNewS.LinkLocal.CommandType:=cmdTable;
请大家帮忙,谢谢!!
var
SL: TStrings;
index: Integer;
begin
SL := TStringList.Create;
try
ADOConnection1.GetTableNames(SL, False);
for index := 0 to (SL.Count - 1) do begin
DBListBox1.Items.Add(SL[index]);
end;
finally
SL.Free;
end;
end;
adoconnection1.GetTableNames(combobox1.items,false);