主题:求救ado连接sql server时不能正确连接 不知何故?
数据库是sql sever2000 采用系统默认登陆
但是无法从数据库库中读出数据
请高手指教!!
源码如下:
procedure Tform19.FormCreate(Sender: TObject);
var
mypath:string;
i:integer;
begin
//mypath:=extractfilepath(paramstr(0));
ADOquery1.ConnectionString:='Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=true;Initial Catalog=wzmanage;Data Source=95F877417B124B1';
ADOquery1.active:=true;
with adoquery1 do
begin
close;
sql.Clear;
sql.add('select * from [user]');
//execSQL;
open;
if RecordCount>1 then
begin
first;
while not eof do
begin
dbcomboBOx1.Items.Add(fieldbyname('user_name').AsString); //添加用户名
next;
end;
end
else
showmessage('当前没有用户');
end;
end;
但是无法从数据库库中读出数据
请高手指教!!
源码如下:
procedure Tform19.FormCreate(Sender: TObject);
var
mypath:string;
i:integer;
begin
//mypath:=extractfilepath(paramstr(0));
ADOquery1.ConnectionString:='Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=true;Initial Catalog=wzmanage;Data Source=95F877417B124B1';
ADOquery1.active:=true;
with adoquery1 do
begin
close;
sql.Clear;
sql.add('select * from [user]');
//execSQL;
open;
if RecordCount>1 then
begin
first;
while not eof do
begin
dbcomboBOx1.Items.Add(fieldbyname('user_name').AsString); //添加用户名
next;
end;
end
else
showmessage('当前没有用户');
end;
end;