string newpass
newpass=sle_5.text
update acc_pass
set password=:newpass
where acc_pass.Password=:sle_3.text;
//using sqlca;
if sqlca .sqlcode<0 then
messagebox("","")
end if
commit;
执行后
数据库没有更新,求帮助
------解决方案--------------------
试下下面的代码吧,应当能解决你的问题,不过偶对你的设计有点疑惑,你的系统里只有密码没有用户名吗?难道是单用户软件?
- C# code
String ls_OldPasswordString ls_NewPasswordString li_Countls_OldPassword = sle_3.Textls_NewPassword = sle_5.TextSELECT COUNT(*) INTO :li_Count FROM ACC_PASS WHERE PASSWORD = :ls_OldPassword;If SQLCA.SQLCode = -1 Then MessageBox("error", "") ReturnEnd IfIf li_Count = 0 Then MessageBox("提示", "原始密码错误,更改密码失败!") ReturnEnd Ifupdate acc_passset password=:ls_NewPasswordwhere acc_pass.Password=:ls_OldPassword;If SQLCA.SQLCode = -1 Then MessageBox("error", "") ReturnEnd IfCOMMIT ;