谢谢大家!作者: 罗ぷ曼ㄉ帝Ke 时间: 2010-1-11 07:04
<%response.End
set rs=server.CreateObject("adodb.recordset")
sql ="select Left,Right from data where gs='" & gs & "'"
rs.open sql,conn,3,2
if tion="左边" then
if rs("left")=0 then
if rs("Right")=1 then%>
<script language="javascript">
alert("左边不行");
history.back();
</script>
<%response.End
end if
end if
end if
If tion="右边" then
if rs("Right")=0 then
if rs("Left")=1 then%>
<script language="javascript">
alert("右边不行");
history.back();
</script>
<%response.End
end if
end if
end if
%>
这个是我自己瞎弄的!就是没效果。。很郁闷作者: 緣妢_兲紸龍 时间: 2010-1-11 07:04
程序代码:
<%
Set Rs = CreateObject("Adodb.RecordSet")
Sql = "Select Top 1 [Left], [Right] From Data Where 你的查询条件"
Rs.Open Sql,Conn,3,2
'tion,Left,Right根据自己的需要从不同途径获取
If tion = "左边" And Rs("Left") = 0 And Rs("Right") = 1 Then
Response.Write "<script>alert(""Sorry!左边不能添加数据!"")</script>"
Response.End()
ElseIf tion = "右边" And Rs("Right") = 0 And Rs("Left") = 1 Then
Response.Write "<script>alert(""Sorry!右边不能添加数据!"")</script>"
Response.End()
Else
Rs.AddNew
Rs("Left") = Left
Rs("Right") = Right
Rs.Update
End If
Rs.Close
Set Rs = Nothing
%>作者: qz沒愛過mm 时间: 2010-1-11 07:04
<%
set rs=server.CreateObject("adodb.recordset")
sql ="select Left,Right from data where gs='" & gs & "'"
rs.open sql,conn,3,2
%>
<%
tion=request.form("tion")
if (tion=Left(Left) and Left(Left)=0 and Right(Right)=1) then
response.Write "对不起!左边不能添加数据 !"
else
rs.addnew
rs("Right")=Right
rs.update
if (tion=Right(Right) and Right(Right)=0 and Left(Left)=1) then
response.Write "对不起!右边不能添加数据 !"
else
rs.addnew
rs("Left")=Left
rs.update
end if
end if