olivebaby 发表于 2007-10-5 11:36

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

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

路過 发表于 2007-10-5 12:59

<P>將and yhkl=:ls_password 去掉,試一下</P>

olivebaby 发表于 2007-10-5 13:00

<P>谢谢</P>

fyh 发表于 2007-10-5 21:57

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

targe123 发表于 2007-10-29 11:03

<P>將and yhkl=:ls_password 去掉,試一下<BR><BR>这个去不去没有关系的,只是他没有在前面为其赋值而已,  ls_password=sle_password.text;</P>

freele_china 发表于 2008-3-15 14:05

去空格 TRIM()

页: [1]

编程论坛