loginprompt 的例子你看了吗? procedure TForm1.SQLConnectionBeforeConnect(Sender: TObject); begin with Sender as TSQLConnection do begin if LoginPrompt = False then begin Params.Values['User_Name'] := 'SYSDBA'; Params.Values['Password'] := Decrypt(Params.Values['Password']); end; end; end;
我把loginprompt设为true,它没有弹出登录对话框。不知什么地方不对。
把ADOConnection的Connected设为True,就OK啦!快结帐!
procedure TForm1.SQLConnectionBeforeConnect(Sender: TObject);
begin
with Sender as TSQLConnection do
begin
if LoginPrompt = False then
begin
Params.Values['User_Name'] := 'SYSDBA';
Params.Values['Password'] := Decrypt(Params.Values['Password']);
end;
end;
end;
ADOConnection1.Connected:=true;
ADOQuery1.Close;
ADOQuery1.Parameters.ParamByName('east').Value:=east1+east2;
ADOQuery1.Parameters.ParamByName('north').Value:=north1+north2;
ADOQuery1.Prepared:=true;
ADOQuery1.ExecSQL;
加入你的代码,还是不行呀。提示undeclared identifier:'params'
~~~~~~~~
ADOQuery1.Parameters.ParamByName('north').Value:=north1+north2我估计你的参数类型错误,你的east字段的类型是什么?
现在出现的问题是说我登录失败。
奇怪的是设计时把ADOConnection的connected设为true,可以弹出对话框进行登录(loginprompt=true),运行时设置却不弹了。delphi5.0不是这样的呀.