控件名称 控件属性
sle_server SingleLineEdit
sle_login SingleLineEdit
sle_oldkl SingleLineEdit
sle_pass SingleLineEdit
sle_repass SingleLineEdit
cb_ commandbutton
cb_ commandbutton
cb_命令按钮的clicked事件如下
string ls_inifilels_passls_logidls_repassls_old
string ls_kls_userls_sql
ls_inifile =rsglini
transaction pub_tr
pub_tr = create transaction
pub_trDBMS = ProfileString (ls_inifile database dbms )
pub_trLogPass = pub
pub_trServerName = sle_servertext
pub_trLogId = pub
pub_trAutoCommit = False
pub_trDBParm =
connect using pub_tr;
ls_old = sle_oldkltext
ls_user = lower(trim(sle_logidtext))
//得到数据库联接原用户口令
select passshadow into :ls_k from tbl_pub_passshadow using pub_tr;
if ls_old <> f_password(ls_k) then
messagebox(提示原口令不对!)
return
end if
//检查核对口令
ls_pass = sle_passtext
ls_repass = sle_repasstext
if ls_repass <> ls_pass then
messagebox(核对口令不对请重新输入!)
return
end if
SetProfileString(ls_inifile Database Servernamesle_servertext)
SetProfileString(ls_inifile Database Logidls_user)
//修改数据库用户的联接口令
ls_sql = alter user +ls_user+ identified by +ls_pass
Execute Immediate :ls_sql using sqlca;
ls_pass = f_password(ls_pass)
UPDATE TBL_PUB_PASSSHADOW SET PASSSHADOW =:ls_pass using pub_tr ;
commit using pub_tr;
commit using sqlca;
disconnect using pub_tr;
close(parent)
cb_命令按钮的clicked事件如下close(parent)
到此万事OK
所有代码已在Win环境下用PowerBuilder 测试通过
编辑推荐
ASP NET开发培训视频教程
Microsoft NET框架程序设计视频教程
[] []