标题:请大家指点一下如何改正.多谢
只看楼主
xinjiye
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2009-11-11
结帖率:100%
 问题点数:0 回复次数:6 
请大家指点一下如何改正.多谢
Microsoft JET Database Engine (0x80040E14)语法错误 (操作符丢失) 在查询表达式 'Id = or SubjectId

代码如下

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/BBS1.asp" -->
<%

if(Request("id") <> "") then Command1__MM_id = Request("id")

%>
<%

set Command1 = Server.CreateObject(")
Command1.ActiveConnection = MM_BBS1_STRING
= "DELETE FROM 论坛  where Id = " + Replace(Command1__MM_id, "'", "''") + " or SubjectId = " + Replace(Command1__MM_id, "'", "''") + " "
= 1
= 0
Command1.Prepared = true
Command1.Execute()

%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<meta http-equiv="refresh" content="2;URL=index1.asp">
</head>
<body bgcolor="#FFFFFF">
已经成功删除帖子,2秒钟后自动返回论坛
</body>
</html>

搜索更多相关主题的帖子: 操作符  
搜索更多相关主题的帖子: 查询 Microsoft Request include 
2009-11-12 19:49
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1214
专家分:1366
注 册:2005-3-14
得分:0 
if(Request("id") <> "") then Command1__MM_id = Request("id")


 
这里确家ID有传递过来吗

http://toorup.3v.do
loading...
2009-11-12 22:02
chenguoxing517
Rank: 7Rank: 7Rank: 7
来 自:广东广州
等 级:黑侠
威 望:1
帖 子:154
专家分:619
注 册:2009-9-28
得分:0 
= "DELETE FROM 论坛  where Id = " + Replace(Command1__MM_id, "'", "''") + " or SubjectId = " + Replace(Command1__MM_id, "'", "''") + " "
改为

= "DELETE FROM 论坛  where Id = " & Replace(Command1__MM_id, "'", "''") & " or SubjectId = " & Replace(Command1__MM_id, "'", "''") + " "
2009-11-13 09:46
aspic
Rank: 17Rank: 17Rank: 17Rank: 17Rank: 17
等 级:贵宾
威 望:51
帖 子:2258
专家分:8050
注 册:2008-2-18
得分:0 
LS的改就改完去 还剩下一个加号没改呢
&是可以连接不同的数据类型+号只能用于连接字符串.
2009-11-13 09:56
chenguoxing517
Rank: 7Rank: 7Rank: 7
来 自:广东广州
等 级:黑侠
威 望:1
帖 子:154
专家分:619
注 册:2009-9-28
得分:0 
楼上所言极是啊
= "DELETE FROM 论坛  where Id = " & Replace(Command1__MM_id, "'", "''") & " or SubjectId = " & Replace(Command1__MM_id, "'", "''") & " "
2009-11-13 12:46
xinjiye
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2009-11-11
得分:0 
谢谢各位
谢谢大家.
2009-11-13 22:36
javaxingxing
Rank: 2
等 级:论坛游民
帖 子:78
专家分:82
注 册:2009-11-6
得分:0 
恩,是啊 一个简单的问题……
2009-11-14 17:19



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-292098-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.091032 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved