我设计了一个身份验证的登陆窗口,在PB里已经和SQL SEVER建立了连接(master目录下的user_Infol表),在窗口“确认”按钮的click事件代码:
string correct_pwd
cb_1.setfocus()
if sle_1.text= " " then
messagebox( "Pay attention! ", "The user name can 't be null! ")
sle_1.setfocus()
elseif sle_2.text= " " then
messagebox( "Pay attention! ", "The password can 't be null! ")
sle_2.setfocus()
else
G_INPUT_TIME=G_INPUT_TIME+1
G_USER=sle_1.text
G_PWD=sle_2.text
select user_PWD into :correct_pwd from user_infol
where user_ID=:G_USER;
if G_PWD=correct_pwd then
open(w_main)
close(w_login)
else
if G_INPUT_TIME > 3 then
messagebox( "警告 ", "输入用户口令次数太多! ")
close(w_login)
else
messagebox( "警告 ", "输入的用户口令有误,请重新输入! ")
end if
end if
end if
发现select user_PWD into :correct_pwd from user_infol
where user_ID=:G_USER;好象出问题了,输入正确的用户名和密码,仍然提示输入错误
请各位帮帮忙问题出在哪儿,谢谢:)
------解决方案--------------------
你在
select user_PWD into :correct_pwd from user_infol
where user_ID=:G_USER;
后面加个messagebox 看看你取的correct_pwd 和输入的密码 ,用户是否一致。
------解决方案--------------------
跟踪一下,看看sqlca.sqlcode和sqlerrtext