SQL删除语句调试不出来,求救

来源:百度知道 编辑:UC知道 时间:2024/06/05 10:52:23
<!--#include file="opendb.asp"-->
<%
sub controlProduct(href)
On Error Resume Next
'oabusyuserdept=request.cookies("oabusyuserdept")
if request("detel")="删除" and request("delid")<>"" then
'set conn=opendb("oabusy","conn","accessdsn")

count=0'
condition=""
for each idno in request("delid")
count=count+1
condition=condition+"cpid=" & sqlstr(idno)
if count<request("delid").count then
condition=condition+" or "
end if
next

sql = "delete * from product where " & condition
conn.Execute sql
end if

set rs=server.createobject("adodb.recordset")
sql="select * from product"
rs.open sql,conn,1
%>
<form action="<%=href%>" method=post>
<tab

sql = "delete * from product where " & condition
你输出一下这条语句,条件应该是错的~

补:condition这里得到的是什么?

sql = "delete * from product where " & condition
因该为sql = "delete * from product where 字段名=" & condition 。如果该字段为字符型,则必须 字段名='" & condition &"'"