Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21' ODBC 驱动程序不支持所需的属性。 /Products.asp,行 187 187行为: rs.open exec,conn,1,1
<%
BigClassID=request.QueryString("BigClassID")
SmallClassID=request.QueryString("SmallClassID")
if  not isnumeric(BigClassID)  or not isnumeric(SmallClassID) then
Response.Write "<script>alert('警告!请勿尝试注入!');history.go(-1);</script>" 
Response.End()
end if
set rs=server.createobject("adodb.recordset") 
if BigClassID="" then
exec="select  * from products order by px_id asc"
end if
if BigClassID<>"" then
exec="select  * from products where BigClassID="&BigClassID&" by px_id asc"
end if
if BigClassID<>"" and SmallClassID<>"" then
exec="select   * from products where BigClassID="&BigClassID&" and SmallClassID="&SmallClassID&" by px_id asc"
end if
rs.open exec,conn,1,1
if rs.eof then
response.Write "<div style=""padding:10px"">暂无产品!</a>"
else
rs.PageSize =""&config("productsclass")&""
iCount=rs.RecordCount 
iPageSize=rs.PageSize
maxpage=rs.PageCount 
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif  page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
end if
For i=1 To x
%>

解决方案 »

  1.   

    exec="select * from products where BigClassID="&BigClassID&" by px_id asc"
    改为
    exec="select * from products where BigClassID=" & BigClassID & " by px_id asc"注意&连接符之间的空格,-----------------------------
    女子女子穴习,二人二人向下下同!
      

  2.   

    哇还没注意呢,原来是还有防止动网注入的一段,我想起了4/5年前那个懵懂的计算机时代请楼主检查conn连接字段,并对变量全部定义,然后检测表名,字段名是否与exec对应,在打开conn和rs前加上if XX.state<>0 then XX.close-----------------------------
    女子女子穴习,二人二人向下