紧急求助!(关于权限设置问题)
<P>有两个表,用户表(id,password)权限表(id,right)在登陆窗口中登陆判断后 ,用全局变量gs_right获取登陆用户的权限值,具体语句怎么写啊,打开主窗口后,判断权限值又应该怎么判断啊。。。<br><br>select userpwd into :pwd from users where userid=:username;<br> if userpwd=trim(pwd) then //符合条件 登陆<br><br> (???????????)<br> <br> open(w_main)<br> close(parent)<br>偶学得差,希望各位大哥大姐多指点啊。先谢谢了。。。</P>[align=right][color=#000066][此贴子已经被作者于2006-5-25 14:22:31编辑过][/color][/align]
<P>加上: <BR>string qx<BR>select reght into :qx from users where userid=:username<BR>if trim(qx)=1 then<BR> open(w_main)<BR>close(parent)<BR>else<BR>open()<BR>close()。。。....<BR>看看对不对</P> <P>权限,你权限表中存储的是什么?<BR>你用户表中的结构又是什么呢?<BR>你可以先判断用户表中的密码,再进行判断其权限.<BR>权限表中应该存储的有用户名与所赋于的权限.<BR>所以直接在权限表中查询就可以了啦!</P> 表 users(id,name,quanxian)其中quanxian为0,1 . 登陆窗口中判断登陆
<P>select userpwd into :pwd from users where userid=:username;<BR> if userpwd=trim(pwd) then<BR> select quanxian into :right from quanxian where userid=:username;//取出该用户的权限值放入全局变量 right中<BR> open(w_main)<BR> close(parent)</P>
<P>w_main的open事件:</P>
<P>if right="1" then //判断权限值</P>
<P> m_main.m_1.enabled=false</P>
<P>end if<BR>我这样做的,但是好象不起作用,难道程序有问题,望大家指点。先谢谢楼上2位大哥了。</P> 你的把权限设置成全局变量吧,是不是? 我是设置的全局变量啊 经判断,应该是IF里边没执行,大家帮我解决下吧....呵呵 表 users(id,name,quanxian)只有这三项,这条语句select userpwd into :pwd from users where userid=:username;你不可能编译过,而且紧跟着if userpwd=trim(pwd) then,“userpwd”到底是变量还是字段名。<BR> 设断点 调试看看right变量是否赋值正确。<BR>建议变量定义有些条理,如:全局变量 string gs_pwd <BR> int gi_pwdi<BR>同理 实例变量则为 string is_pwd<BR>int ii_pwdi *** 作者被禁止或删除 内容自动屏蔽 ***
页:
[1]
