|
程序代码:
<%
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
%> |
|