ASP删除数据

来源:百度知道 编辑:UC知道 时间:2024/05/27 23:47:05
<title>数据处理</title>
<link href="sty.css" rel="stylesheet" type="text/css">
<body bgcolor="#D4D0C8" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border:none">
<p align="center"> <span class="t-main">正在删除记录</span></p>
<p align="center" class="t-main">请稍候……</p>
</body>
<!--#include file="../data_base/conn.asp"-->
<%
id=cint(request("id"))
title=trim(request("title"))
if title="news" then
Text="Delete from [news] where [id]="&id
else
set GetImgName = conn.execute("select * from [products] where Id="&request("id")&"")
set FileObj = server.createobject("scripting.filesystemobject")
IF FileO

删除ID两边的括号:
delect * from [Table] where ID="&id
如果还是不可以的话
去掉页面(或包含页面)中on error resume next的语句,再看错误提示!

set rs=server.createobject("adodb.recordset")
Text="select * from [products] where id="&id
rs.open Text,conn,1,3
rs.delete

一楼删除的写错了,是delete
把[]去掉,另外输出一下response.write(Text),看SQL语句是怎么执行的