procedure Tdenglu.FormCreate(Sender: TObject);
var
i:integer;
adoquery1:Tadoquery;
adoconnection1:Tadoconnection;
begin
try
label1.Caption:=formatDateTime('yyyy"年"m"月"d"日"', Now)
+'('+formatdatetime('aaaa',date)+')';
//动态创建adoconnection,adoquery
// adoconnection1:=Tadoconnection.create(nil);
//adoconnection1.ConnectionString:=
//'provider=microsoft.jet.oledb.4.0;data source='
//+extractfilepath(paramstr(0))+'tushudatabase.mdb;'+'jet oledb:database password='
//+';persist secutity info=false';
adoquery1:=Tadoquery.create(nil);
adoquery1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=J:/编程/hygsxy/tushudatabase.mdb;Persist Security Info=False';
//adoquery1.connection:=adoconnection1;
with adoquery1 do
begin
sql.clear;
sql.add('select 登陆用户名 from 权限密码表' );
open;
first;
for i:=0 to recordcount-1 do
begin
yonghuming.Items.Add(fieldbyname('登陆用户名').asstring);
next;
end;
close;
end;
finally
;
end;
end;
-------------------------------------------------------------------------------------------
happy_zhg, 你的方法很有效.这样的话,通过了,没错误.看样子是connectionstring='.........'有问题了.帮着再看一下,.