|
错误类型:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'id=' 中。
/15源/do.asp, 第 10 行
<!--#include file = "conn.asp"-->
<!--#include file = "md5.asp"-->
<%
Dim Adrs,subject,SCrs,SCrsOld,CPrs,MFrs,tempOld,temp,DTrs,DQrs,name
If Request.QueryString("act") = "SetCurrent" Then
subject = Request.Form("Subject")
Set SCrsOld = Server.CreateObject("ADODB.RecordSet")
SCrsOld.Open "Select * from subject where process = ""True""",conn,1,3
Set SCrs = Server.CreateObject("ADODB.RecordSet")
SCrs.Open "Select * from subject where id="&subject,conn,1,3
If Not (SCrsOld.EOF and SCrsOld.BOF) Then
'temp = SCrs("process")
SCrs("process") = "True" 'Trim(SCrsOld("process"))
SCrs.Update
SCrsOld("process") = "False" 'Trim(temp)
SCrsOld.Update
Else
SCrs("process") = True
SCrs.Update
End If
'SCrs.Update
Response.Redirect "Admin.asp?action=Set&result=Successful&subject="&SCrs("subject")
SCrs.Close
Set SCrs = nothing
SCrsOld.Close
Set SCrsOld = nothing
ElseIf Request.QueryString("act")="changemsg" Then
Set CPrs=Server.CreateObject("ADODB.RecordSet")
CPrs.open "Select * from Admin ",conn,1,3
If Not (CPrs.EOF and CPrs.BOF) Then
CPrs("AdminName")=Request.Form("username")
if Request.Form("password")<>"" Then
CPrs("password")=md5(Request.Form("password"))
End If
CPrs("RestrictIP")=Request.Form("RestrictIP")
CPrs.update
CPrs.close
Set CPrs=nothing
Else
Response.Redirect "admin.asp?action=ChangeMsg&result=Failure"
End If
Response.Redirect "admin.asp?action=ChangeMsg&result=Successful"
ElseIf Request.QueryString("act")="Add" Then
Set ADrs=Server.CreateObject("ADODB.RecordSet")
ADrs.open "Select * from Subject",conn,1,3
ADrs.addnew
ADrs("subject")=Trim(Request.Form("newsubject"))
ADrs.update
ADrs.close
Set ADrs=nothing
Response.Redirect "Admin.asp?action=AddSubject"
ElseIf Request.QueryString("act")="modify" Then
Set MFrs=Server.CreateObject("ADODB.RecordSet")
MFrs.open "Select * from Subject where id="&Request.Form("sid"),conn,1,3
If not (MFrs.eof and MFrs.bof) Then
MFrs("subject")=Trim(Request.Form("Subject"))
MFrs.update
MFrs.close
Set MFrs=nothing
End If
Response.Redirect "admin.asp?action=Modify"
ElseIf Request.QueryString("act")="del" Then
Set DTrs = Server.CreateObject("ADODB.RecordSet")
DTrs.open "Select * from Title where sid="&Request.QueryString("sid"),conn,1,3
If Not (DTrs.EOF and DTrs.BOF) Then
Do While Not DTrs.EOF
Set DQrs = Server.CreateObject("ADODB.RecordSet")
DQrs.open "Select * from Question where tid="&DTrs("id"),conn,1,3
If Not (DQrs.EOF and DQrs.BOF) Then
Do While Not DQrs.EOF
conn.execute("delete from Question where id="&DQrs("id")&"")
DQrs.MoveNext
Loop
End If
conn.execute("delete from Title where id="&DTrs("id")&"")
DTrs.MoveNext
Loop
End If
conn.execute("delete from Subject where id="&Request.QueryString("sid")&"")
Response.Redirect "Admin.asp?action=Delete"
End If
Call EndConnection()
%> |
|