学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
发新话题
打印

我编了一个登录的程序,可是输正确的用户名和密码进不去,请教!

我编了一个登录的程序,可是输正确的用户名和密码进不去,请教!

string ls_user,ls_password
ls_user=sle_user.text

if sle_user.text="" or sle_password.text="" then
messagebox("","用户名或口令不能为空!")
return
end if
select yhkl
into:ls_password
from yhkl
where yhmc=:ls_user and yhkl=:ls_password
using sqlca;
if sle_password.text=ls_password then
open(w_main)
close(parent)
else
messagebox("","用户名或口令错误!")
end if

TOP

將and yhkl=:ls_password 去掉,試一下

TOP

谢谢

TOP

string ls_user,ls_password,ls_passValue
ls_user=Trim(sle_user.text)
ls_password = trim(sle_password.text)

if (ISnull(ls_user) or ls_User = '') OR (ISNULL(ls_password )or ls_password = '') then
messagebox("","用户名或口令不能为空!")
return
end if
select yhkl
into:ls_passValue
from yhkl
where yhmc=:ls_user;
using sqlca;
if ls_PassValue=ls_password then
open(w_main)
close(parent)
else
messagebox("","用户名或口令错误!")
end if

TOP

將and yhkl=:ls_password 去掉,試一下

这个去不去没有关系的,只是他没有在前面为其赋值而已, ls_password=sle_password.text;

代做PB程序设计QQ:252472144

TOP

去空格 TRIM()
雁过留声,人过留名

TOP

发新话题