注册 登录
编程论坛 PowerBuilder

登录代码问题 求助

qin20082012 发布于 2011-09-01 19:04, 496 次点击
非常郁闷! 请各位高手帮忙
运行下列代码时时老是提示"密码错误"



string ls_uname,ls_pwd1,ls_pwd2,ls_sno,ls_s1
ls_uname=sle_uname.text
ls_pwd1=sle_pwd.text
select sno
into :ls_sno
from t_student
where t_student.sno=:ls_uname;
if sle_uname.text="" or sle_pwd.text="" then
messagebox("提示","用户名或密码不能为空,请输入用户名或密码!")
sle_uname.text=""
sle_pwd.text=""
return
end if
select password
into :ls_pwd2
from t_student
where t_student.sno = :ls_uname ;
if ls_pwd1 =ls_pwd2 then
open(w_main)

else
messagebox("错误","用户名或密码错误,请重新输入!")
sle_pwd.text=""
return
end if
3 回复
#2
qin200820122011-09-01 19:46
高手们,快啊
#3
qin200820122011-09-01 20:40
各位大侠,赶紧的
#4
xjyang_yang2011-12-19 18:26
这是我的登录代码,看一下:
string ls_username,ls_password

ls_username=sle_username.text
ls_password=sle_password.text

string ls_sql


select top 1 usermessage.username
    into :gs_operator
    from usermessage
    where usermessage.username=:ls_username and usermessage.password=:ls_password;   

   
if sqlca.sqlcode =0 then
    ii_close = 1
    open(w_main)
    close(parent)
else
    ii_number =ii_number+1
    if ii_number<3 then
        sle_username.text=""
        sle_password.text=""
        sle_username.setfocus()
    else
        messagebox("系统提示","您已经尝试登陆三次,系统自动退出。")
        ii_close = 1
        close(parent)
    end if
end if
1