得到错误ADODB.Recordset错误' 800a0bb9'参数类型错误,超出可接受的范围,或彼此冲突

时间:2016-12-10 04:38:07

标签: asp-classic

我正在尝试将数据从数据库绑定到我的页面,代码在下面给出

  
 Dim oCon, pages, Rec, DisplayNum, i, page, SQL, ipage, z, MaxRows
    Set QGetList = Server.CreateObject ("ADODB.Recordset")
    'QGetList.PageSize = MaxRows
    'QGetList.CursorLocation = adUseClient 
'Set QGetProgramItem = Server.CreateObject("ADODB.Recordset")
            SQL =   " SELECT ModelRow, SeriesRow, ModelCode, Item.* FROM tblSPCMaster_Item Item " &_
                    " LEFT OUTER JOIN viewModelSeries VM on VM.vch_ModelName = Item.vModelName AND VM.modelcode = Item.vModelCode " &_
                    " WHERE iSPCMasterID = '"  & Request.querystring("PID") & "' ORDER BY ModelRow, SeriesRow, Item.iSeq"
            QGetList.Open SQL, dpconn, 1
    ipage = QGetList.PageCount


    if QGetList.EOF OR QGetList.BOF Then
        x = 1
    else
        if page = 0 or page > ipage Then
            QGetList.AbsolutePage = ipage
        else
            QGetList.AbsolutePage = page
        end if  
    end if


    Response.ContentType = "application/vnd.ms-excel"
    Response.AddHeader "Content-Disposition", "attachment; filename=Stock_Inventory_Management_Export_" & Year(now) & Month(now) & day(now) & hour(now) & minute(now) & ".xls"

我收到错误:

  

ADODB.Recordset错误' 800a0bb9'

     

参数类型错误,超出可接受的范围,或彼此冲突。

我想念的是我没有得到请帮帮我

1 个答案:

答案 0 :(得分:0)

这一行:

QGetList.Open SQL, dpconn, 1

对于第一个参数,它需要一个Command对象。你给了它一个字符串。

修复SQL注入漏洞。

相关问题