Strange behaviour of a query

Discussion in 'General Web Coding' started by zaboss, Dec 8, 2008.

  1. zaboss

    zaboss Perch

    Hi,
    I have an application in classic ASP and I want to make an alphabetic paging.
    If I grab the recordset this way:
    Code:
    ...
    ElseIf Request.Querystring("sortby")="let" then
    msql = "SELECT * FROM tblCandidati Left Join tblIndustrii on tblCandidati.strIndustry=tblIndustrii.indID WHERE tblCandidati.strNume LIKE '" & Request.Querystring("ltr") & "%' ORDER by strNume ASC, strPspamSpamme ASC"
    End if
    Set RS = Server.CreateObject("ADODB.Recordset")
    RS.Open msql, MyConn, 1, 3
    
    it generates an error:ADODB.Recordset error '800a0bb9'

    Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
    If i run it directly
    Code:
    SET RS=MyConn.Execute("SELECT * FROM tblCandidati Left Join tblIndustrii on tblCandidati.strIndustry=tblIndustrii.indID WHERE tblCandidati.strNume LIKE '" & Request.Querystring("ltr") & "%' ORDER by strNume ASC, strPspamSpamme ASC")
    
    it works. My problem is that I also want paging (it may return 100s of records).
    Any hint most appreciated.

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services