begin
ADOQuery1.close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Text:='select password from userinfo where username='''+label2.Caption +'''';
Adoquery1.open;
if edit1.Text<>Adoquery1.Fields[0].AsString then
begin
Application.MessageBox('原密码不正确','警告',MB_ICONWARNING);
exit;
end;
if ((trim(edit2.Text)='') or (trim(edit3.text)='') )then
begin
Application.MessageBox('新密码和确认密码不能为空','警告',MB_ICONWARNING);
exit
end;
if edit2.Text<>edit3.text then
begin
Application.MessageBox('两次密码不一致','警告',MB_ICONWARNING);
exit;
end;
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.text:='update userinfo set password='''+edit2.text+''' where username='''+Label2.Caption+'''';
ADOQuery1.ExecSql;
application.MessageBox('成功修改密码','成功',mb_iconwarning);
exit;
end;
end;
end.
ADOQuery1.close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Text:='select password from userinfo where username='''+label2.Caption +'''';
Adoquery1.open;
if edit1.Text<>Adoquery1.Fields[0].AsString then
begin
Application.MessageBox('原密码不正确','警告',MB_ICONWARNING);
exit;
end;
if ((trim(edit2.Text)='') or (trim(edit3.text)='') )then
begin
Application.MessageBox('新密码和确认密码不能为空','警告',MB_ICONWARNING);
exit
end;
if edit2.Text<>edit3.text then
begin
Application.MessageBox('两次密码不一致','警告',MB_ICONWARNING);
exit;
end;
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.text:='update userinfo set password='''+edit2.text+''' where username='''+Label2.Caption+'''';
ADOQuery1.ExecSql;
application.MessageBox('成功修改密码','成功',mb_iconwarning);
exit;
end;
end;
end.
解决方案 »
- 急,关于回调问题,见内容,谢谢
- 用DELPHI读取EXE_DLL文件的相关参数
- 高手指点----delphi 如何实现整型到实型的类型转化????
- 求教----如何能让程序开机自动执行然后如何取消这个功能??????
- 为什么我用DELPHI在WIN2K下写的程序在WIN98下LABEL字体变大?
- 请问:我用了一个Paintbox来画图,我怎么才可以改变他的背景色,就像windows画板那样?
- 怎樣將原來用Delphi與SQL Server編寫好的應用程序移植到另一台SQL Server服務器上?
- 为什么MDIChild窗体关不掉?
- 使用ADO时,说interface not supported是怎么回事?
- 一个SQL语句在DELPHI中参数代入的问题
- FreeLibrary DLL 处理 Webbrowser 内存泄露
- delphi 开发64位系统 需要MD5计算 怎么把原来32位的MD5转64位
不过还是要谢谢上面的大侠
这样写会比较清晰,建议使用QuotedStr函数,这个函数很好用的