村支委换届会议记录:asp实现 文件权限

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/05 11:08:45
我有两个表,主表名(file)中有:关键字:id title等字段.权限表(allow)中也有关键字:id title,username字段.
例:file 中:
id title
1 file1
2 file2
........
allow中
id title username allow_read(由checkbox控制)
1 file1 user1 yes(默认值为no)
2 file1 user2 no
3 file2 user3 yes
现在我要的效果是:
当选中file1 时,从allow表中找查相关username (也就是说有权限查看file1文件的会员)的记录,看 allow_read 是否值为yes。如果为yes ,则可以打开file1,如果为no则提示没有权限!
我的分不多,全部给了,谁能帮帮忙!急,谢谢啦!
sql1="select * from file where username='"&session("user")&"'"
这里我用的是cookies,file中没有username这个字段,allow中才有
oabusyusername=request.cookies("oabusyusername")
sql1="select * from allow where username='"&oabusyusername&"'",这句提示“=”附近有语法错误,
这句,语法应该没错吧,我不知道问题在哪里,请指教!

<%
form_check=request.form("checkbox") '获取checkbox

set rs1=server.createobject("adodb.recordset")
sql1="select * from file where username='"&session("user")&"'"
rs1.open sql1,conn,1,3

if form_check="yes" then
set rs2=server.createobject("adodb.recordset")
sql2-"select * from allow where title='"&rs1("title")&"'"
rs2.open sql2,conn,1,3
.............

end if
%>