资源描述
局域网图书资料查询系统
needitsle_1propeties:passwd
登录日期editmaskem_1masktype:datamm/dd/yyyy
表5-1登录模块控件信息表
控件:sle_1事件(event):modifiedscriptofmodified:
stringinput_code,namesetfocusfile://将光标定位在该控件
input_code=string(this.text)file://接收用户输入的值,并赋值给变量selectnameinto
:namefromkeeperwhereid=:input_codeorpym=:input_code;//从用户表里查找满足输入条件
的记录ifsqlca.sqlcode=0thenthis.text=namesetfocus(sle_2)file://查找成功,则光
标跳转到“口令”控件elseifsqlca.sqlcode=100thenmessagebox("提示。",;"对不起,
用户不存在。",;stopsign。)return1file://查找不到符合条件的记录则提示else
messagebox("错误。",;"error:"+string(sqlca.sqldbcode);+"information:"+sqlca.
sqlerrtext)file://sql出错提示endifendif
控件:sle_2事件(event):modifiedscriptofmodified:
stringinput_passwd,passwd,droitinput_passwd=righttrim(this.text)//去掉输入值右边的空
格selectpasswdinto:passwdfromkeeperwherename=:sle_1.text;passwd=righttrim(
passwd);//从用户表中校验口令的正确性ifsqlca.sqlcode=0thenifinput_passwd
passwdthenmessagebox('口令错误','对不起,请重新输入',stopsign。);sle_2.
selecttext(1,len(sle_2.text))this.clear//口令错误则清除输入内容setfocus
(sle_2)elseifinput_passwd=passwdthenuser=righttrim(sle_1.text)selectdroit
into:droitfromkeeper
wherename=:user;//口令正确将用户操作权限赋值给变量
open(main)//打开程序主窗口close(w_login)//关闭登录窗口endifelseif
sqlca.sqlcode=100thenmessagebox('提示。','无数据',stopsign。)return1else
messagebox("错误。",;"error:"+string(sqlca.sqldbcode);+"information:"+sqlca.
sqlerrtext)file://sql出错提示endif
在登录模块中,用户可输入自己的编号或编码来登录系统。系统会根据用户输入的编号或编码值
来自动给出确实已存在库中的用户中文名,若查找不到库中相匹配的记录则提示出错或重输。若
用户存在,则提示输入口令,口令正确则会顺利进入该系统主界面。
§5.3查询模块的实现
图5-3查询窗口
该窗口(w_main)控件列表如下:
风n
第3页 共3页
展开阅读全文