| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 527 人关注过本帖
标题:请高手看看这段代码有什么错误
只看楼主 加入收藏
andrew518
Rank: 1
等 级:新手上路
帖 子:144
专家分:0
注 册:2005-10-5
收藏
 问题点数:0 回复次数:4 
请高手看看这段代码有什么错误

<%@LANGUAGE="VBSCRIPT"%> <style type="text/css"> <!-- .style1 { font-size: 24px; color: #003399; } --> </style> <title>删除留言</title><div align="center" class="style1">删除留言 </div> <!--#include file="../Connections/liuyan.asp" --> <% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="" MM_authFailedURL="login.asp" MM_grantAccess=false If Session("MM_Username") <> "" Then If (true Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <%

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

%> <%

set Command1 = Server.CreateObject("ADODB.Command") Command1.ActiveConnection = MM_liuyan_STRING Command1.CommandText = "DELETE FROM liuyandata WHERE id=" + Replace(Command1__strid, "'", "''") + "" Command1.CommandType = 1 Command1.CommandTimeout = 0 Command1.Prepared = true Command1.Execute()

%> <% if(commdel_strid<>"")then set Commdel=Server.CreateObject("ADODB。Command") Commdel。ActiveConnection=MM_connliuyandb_STRING Commdel。CommandText="DELET FROM liuyandata WHERE id="+Replace(Commdel_strid,"''","''")+ "" Commdel。CommandType=4 Commdel。CommandTimeout=0 Commdel。Prepared=ture Commdel。Execute() end if '执行删除操作后,转到其他页面 reponse。Redirect("admin。asp") %> 这是留言本中的del.asp删除页面的代码,但我打开时却显示不了,怎么回事?

搜索更多相关主题的帖子: 代码 
2005-10-14 19:17
rainic
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2367
专家分:0
注 册:2005-8-9
收藏
得分:0 
你怎么用“。”号????

2005-10-14 21:04
andrew518
Rank: 1
等 级:新手上路
帖 子:144
专家分:0
注 册:2005-10-5
收藏
得分:0 
惭愧,但改了还是不行
2005-10-14 21:21
andrew518
Rank: 1
等 级:新手上路
帖 子:144
专家分:0
注 册:2005-10-5
收藏
得分:0 
这是一个执行留言删除的页面,求助求助
2005-10-15 10:45
andrew518
Rank: 1
等 级:新手上路
帖 子:144
专家分:0
注 册:2005-10-5
收藏
得分:0 

错误类型: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'id=' 中。 第 46 行 第46行是:Command1.Execute() 全页代码是如下 <%@LANGUAGE="VBSCRIPT"%> <style type="text/css"> <!-- .style1 { font-size: 24px; color: #003399; } --> </style> <title>删除留言</title> <div align="center" class="style1"></div> <!--#include file="../Connections/liuyan.asp" --> <% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="" MM_authFailedURL="login.asp" MM_grantAccess=false If Session("MM_Username") <> "" Then If (true Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <%

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

%> <%

set Command1 = Server.CreateObject("ADODB.Command") Command1.ActiveConnection = MM_liuyan_STRING Command1.CommandText = "DELETE FROM liuyandata WHERE id=" + Replace(Command1__strid, "'", "''") + " " Command1.CommandType = 1 Command1.CommandTimeout = 0 Command1.Prepared = true Command1.Execute()

%> <%

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

%> <% if(commdel_strid<>"")then set Commdel=Server.CreatObject("ADODB.Command") Commdel.ActiveConnection=MM_connliuyandb_STRING Commdel.commandText="DELETE FROM liuyandata WHERE id="+Replace(Commdel_strid,"","")+"" Commdel.CommandType+4 Commdel.CommandTimeout+0 Commdel.Prepared=true Commdel.Execute() end if '执行删除操作后,转到其他页面 response.Redirect("admin.asp") %> <html> <head> <meta http-equiv="content-Type"content="text/html:charset=gb2312"> </head> <body>

</body> </html> 我是在DW中做的编辑,我设的SQL是DELETE FROM liuyandata WHERE id=strid 请高手帮忙

2005-10-16 10:29
快速回复:请高手看看这段代码有什么错误
数据加载中...
 
   



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

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