请求这个ASP语句错误的修改

来源:百度知道 编辑:UC知道 时间:2024/06/09 21:06:08
错误类型:
Microsoft JET Database Engine (0x80040E07)
标准表达式中数据类型不匹配。
/htgl/admin/add_product1.asp, 第 57 行

56行:
sql="select * from p_info where pid="&request.QueryString("p_id")&" order by id asc"
57行:
rs.open sql,conn,1,1
请问这是哪里的错误?

要看看你的数据库里面pid是什么类型的字段了。如果是数字或者自动编号,那么像一楼的那样就可以了,如果是文本类型的,那么要写成
sql="select * from p_info where pid='"&request.QueryString("p_id")&"' order by id asc"

试试下面语句:
sql="select * from p_info where pid="&CINT(request.QueryString("p_id"))&" order by id asc"