zyfoggy 发表于 2007-5-25 18:27

[求助]pb的人事管理系统登陆界面代码问题

<P>麻烦哪位大虾帮我看下,这是怎么回事。<BR>这个是系统设置的用户、口令、权限</P>
<P>[attach]21427[/attach]<BR><BR>下面是代码,运行后登陆系统总是显示‘输入有误,请重新输入’<BR><BR>//string now_grade<BR>string correct_pswd,sdate<BR>time d_date<BR>d_date=now()<BR>sdate=string(d_date)<BR>if sle_1.text="" or sle_2.text="" then<BR>    messagebox("警告!","用户名密码不能为空")<BR>    sle_1.setfocus( )<BR>    sle_2.setfocus( )</P>
<P>else<BR>    g_input_time=g_input_time+1<BR>    g_user=sle_1.text<BR>    g_pwd=sle_2.text<BR>   g_power=sle_3.text</P>
<P><BR>select user_pwd into :correct_pswd from user_info <BR>where user_id=:g_user;<BR>    <BR>if trim(g_pwd)=trim(correct_pswd) then</P>
<P>select user_power into :g_power from user_info  </P>
<P>where user_id=:g_user;<BR>open(w_main)<BR>//close(w_login)<BR>                <BR> if trim(g_power) = "管理员" then<BR>  <BR>  w_main.ChangeMenu(m_menu)<BR>  // w_main.ToolbarVisible = true<BR>else<BR>  <BR>  w_main.ChangeMenu(m_menuist)<BR> //w_main.ToolbarVisible = true<BR> end if<BR> close(w_login)<BR>                </P>
<P>else<BR>        <BR>        if g_input_time&gt;2 then<BR>            messagebox("警告","输入用户名口令的次数太多!")<BR>            close(w_login)<BR>        else<BR>            messagebox("警告","输入有误,请重新输入")<BR>        end if<BR>    end if<BR>end if<BR>//end if<BR><BR><BR><BR>麻烦帮我看下,代码是不是有问题,谢谢阿</P>

路過 发表于 2007-5-28 08:08

用messagebox測試一下

黎明前的黑暗 发表于 2007-6-7 15:29

当然有问题了,你主窗体都出来了,自然是登陆成功了,你还判断登陆次数干什么?<br>if g_input_time&gt;2 then<br>            messagebox("警告","输入用户名口令的次数太多!")<br>            close(w_login)<br>        else<br>            messagebox("警告","输入有误,请重新输入")<br>        end if<br>这段代码不用写ELSE.而且要在OPEN主窗体之前写.<br>

页: [1]

编程论坛