设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 720|回复: 0
打印 上一主题 下一主题

[Access本身] SOS:提示语法错误(操作符丢失)

[复制链接]
跳转到指定楼层
1#
发表于 2007-12-31 21:12:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
错误类型:
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()
%>
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-12-1 20:27 , Processed in 0.088718 second(s), 25 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表