如下所示:
AdoQuery1.Connection :=FormPassword.ADOConnection1;
with AdoQuery1do begin
//Close;
SQL.Clear;
tempstr:='Update Users set PWD='''+trim(Edit2.Text)+''' where UserID='''+UserID+'''';
SQL.Text:=tempstr;
open;
end;
运行时发生错误:Missing Connection or Connectionstring.
不知为何,请赐教!
AdoQuery1.Connection :=FormPassword.ADOConnection1;
with AdoQuery1do begin
//Close;
SQL.Clear;
tempstr:='Update Users set PWD='''+trim(Edit2.Text)+''' where UserID='''+UserID+'''';
SQL.Text:=tempstr;
open;
end;
运行时发生错误:Missing Connection or Connectionstring.
不知为何,请赐教!
解决方案 »
- 请问这段代码的作用(汇编)
- fastReoprt 4.2 改了很多东西,重大发现 SetSizeAndDimensions(256, PageW, PageH);
- 求肋,请教一下,*************爱你一万年*********的问题??
- 怎样定义一个public 的二维数组?
- 望能指点一二:仍旧是dbgrid的打印结果问题 我才开始学习delphi7
- 如何在DELPHI中调用带参数的存储过程???????
- 关于select 的问题设置某部查询
- 今天偶生日,散分
- 回车键的键值是多少?
- 怎样让用户来选择保存的位置?
- 有谁能提供UDP协议的实例?
- 怎样在delphi界面中对execl工作表进行数据操作?
检查检查看看?
AdoQuery1.Connection :=FormPassword.ADOConnection1;
with AdoQuery1 do begin
Close;
SQL.Clear;
tempstr:='Update Users set PWD='''+trim(Edit2.Text)+''' where UserID='''+UserID+'''';
SQL.Text:=tempstr;
--> sqlexec;
end;bad english, try it!
ADOQrury1,sql.clear;
ADOquery1.sql.add('update tablename set pwd=:p1 where userID=:p2');
ADOquery1.parameter.parambyname('p1').values:=form1.edit1.text;
ADOquery1.parameter.parambyname('p2').values:=form1.edit2.text;
try
adoqurey1.execsql;
except end;
只有Select才能用Open;
AdoQuery1.Connection :=FormPassword.ADOConnection1;
with AdoQuery1 do begin
Close;
SQL.Clear;
SQL.Add('Update Users set PWD=:P1 where UserID=:P2');
Parameters.ParamByName('P1').Value :=NewPassword;
Parameters.ParamByName('P2').Value :=UserID;
ExecSQL;
end;
sql_string := 'update tbl_oper set oper_passwd='''+suiedit2.Text+
''' where oper_acct='''+ mainform.useracct+'''';
with datamd.tbl_oper do //datamd.tbl_oper为另一个单元的adouqery控件
begin
active := false;
sql.Clear;
sql.Add(sql_string);
execsql();
end;