初来贵地, 还望多指教!!
遇到个比较棘手的问题,请看下面删除记录的语句:
set rsD=server.CreateObject("adodb.recordset")
if mulu_type="shenghuo" then
sqlD="delete * from shenghuo where Sno=CLng('" & request("num") & "')"
end if
if mulu_type="wuhou" then
sqlD="delete * from wuhou where Sno=CLng('" & request("num") & "')"
end if
if mulu_type="qinggan" then
sqlD="delete * from qinggan where Sno=CLng('" & request("num") & "')"
end if
if mulu_type="yishu" then
sqlD="delete * from yishu where Sno=CLng('" & request("num") & "')"
end if
if mulu_type="wuzi" then
sqlD="delete * from wuzi where Sno=CLng('" & request("num") & "')"
end if
* conn.execute(sqlD)
运行结果*号这句错误:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E0C)
没有为命令对象设置命令。
以上代码是经下面代码改造而来,在另外一个页面中如下代码能正常运行.
set rs_del=server.CreateObject("adodb.recordset")
sql_del="delete * from admin where Num=CLng('" & request("num") & "')"
conn.execute(sql_del)
请帮忙指出错误的原因,谢谢!!!
[此贴子已经被作者于2006-11-15 13:32:23编辑过]