我编了一个登录的程序,可是输正确的用户名和密码进不去,请教!
<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>
<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> <P>將and yhkl=:ls_password 去掉,試一下<BR><BR>这个去不去没有关系的,只是他没有在前面为其赋值而已, ls_password=sle_password.text;</P> 去空格 TRIM()
页:
[1]
