晕倒, 太简单了, 我想复杂了,flyforever81告诉他吧
在数据库中加一个字段,比如modify,假如其它会员修改了就rs其值为False,否则为True.
这个怎么实现啊?
因为我会先录入一条记录,需要他们修改一次,无论谁修改了,这条记录就不能改了,除了我之外.开始是我没表述清楚
有办法,在test表中加一个字段user_state(数字型,默认为0)
<!--#include file="conn.asp"-->
<%if session("admin")="1" then
exec="select * from test where id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
rs("aa")=request.form("aa")
rs("cc")=request.form("cc")
rs("bb")=request.form("bb")
rs.update
else
exec="select * from test where id='"&request.form("id")&"'" and user_state=0 "
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
if rs.eof then
rs("aa")=request.form("aa")
rs("cc")=request.form("cc")
rs("bb")=request.form("bb")
rs("user_state")=1
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "list.asp"
<!--#include file="conn.asp"-->
<%if session("admin")="1" then
exec="select * from test where id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
rs("aa")=request.form("aa")
rs("cc")=request.form("cc")
rs("bb")=request.form("bb")
rs.update
else
exec="select * from test where id='"&request.form("id")&"'" and user_state=0 "
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
if rs.eof then
rs("aa")=request.form("aa")
rs("cc")=request.form("cc")
rs("bb")=request.form("bb")
rs("user_state")=1
rs.update
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "list.asp"