判断某个数据是否为空

来源:百度知道 编辑:UC知道 时间:2024/05/28 15:05:57
代码如下:
<%dim Product_id
Product_id=request.QueryString("Product_id")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from P_product where Product_id='"&Product_id&"' ",conn,1,1
if rs("P_number2")<>"" then
response.write "<p align=center>你所选购的商品没有库存了!<br>订单取消,请有货时再来购买!</p>"
response.End
end if
%>

老是提示:
rs.open "select * from P_product where Product_id='"&Product_id&"' ",conn,1,1
这一行出错,错误提示是:
ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

这是定单的请求页面,就是点商品下的定购按钮,跳转到这里来的,其它商品的ID名是P_id

product_id是商品的编号

请高手帮忙看一下,如果需要源文件我可以贴出整个来的

rs.open "select * from P_product where Product_id="&Product_id& ",conn,1,1
如果不行就这样改
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from P_product where Product_id='"&Product_id& "'"
response.write sql'查看获得的参数
response.end()
rs.open sql,conn,1,1
if rs("P_number2")<>"" then
response.write "<p align=center>你所选购的商品没有库存了!<br>订单取消,请有货时再来购买!</p>"
response.End
end if
%>