Dynamic Grid using ASP and SQL server, problems loading more


Hi guys,



I’m struggling again I think down to the lack of ASP documentation.  Be great if you could point me in the right direction.  I can get the initial rows to populate then when I scroll down I get an XML error.  No clue why so here’s the code…



 












 



- - - - - - - -



then this is my ASP page… (getGridRecords.asp)



 



<%@ LANGUAGE = VBScript %>
<% option explicit %>


<% call open_conn() %>
<%
   
    ’ set content type and xml tag
    Response.ContentType = “text/xml”
    Response.write("<?xml version=""1.0"" encoding=""UTF-8""?>")



    ’ define variables from incoming values
    Dim posStart, count
    If not isEmpty(Request.QueryString(“posStart”)) Then
        posStart = Request.QueryString(“posStart”)
    Else
        posStart = 0
    End If   



    If not isEmpty(Request.QueryString(“count”)) Then
        count = Request.QueryString(“count”)
    Else
        count = 100
    End If   
   
    ’ query to products table
    sql = “dbo.SP_my_msdss_all " & posStart & “,” & count



    ’ if this is the first query - get total number of records in the query result
    Dim sqlCount, totalCount
    If posStart = 0 Then
  Call open_read(sql,0)
        totalCount = rc(“cnt”)
    Else
        totalCount = “”   
    End If



    ’ Next recordset
 set rc = rc.nextRecordSet()
 
 getResults = rc.getrows()
   
    ’ output data in XML format  
    Response.write(”")
    for counter=0 to ubound(getResults,2)
        Response.write("")
            Response.write("")
                Response.write(getResults(1,counter))  ’ value for product name
            Response.write("")
            Response.write("")
                Response.write(getResults(2,counter))  ’ value for internal code
            Response.write("")
            Response.write("")
                Response.write(getResults(0,counter))    ’ value for price
            Response.write("")
        Response.write("")
    next
    Response.write("")
    rc.Close()



%>
<% call close_conn() %>




Thanks for the help!




Dale

Incorrect XML error means that printed data has XML syntax errors, in case of dyn. generation of data, most possible reason

- some script error occurs during data generation and error info corrupt XML
- data was printed in different encoding than XML ( iso-8859-1 vs UTF ) which cause xml syntax error

To check exact reason, you can load the same url ( getGridRecords.asp with parameters ) in separate window or use debug version of dhtmlxcommon.js

dhtmlx.com/docs/products/kb/inde … tmlxcommon

Incorrect XML error means that printed data has XML syntax errors, in case of dyn. generation of data, most possible reason

- some script error occurs during data generation and error info corrupt XML
- data was printed in different encoding than XML ( iso-8859-1 vs UTF ) which cause xml syntax error

To check exact reason, you can load the same url ( getGridRecords.asp with parameters ) in separate window or use debug version of dhtmlxcommon.js

dhtmlx.com/docs/products/kb/inde … tmlxcommon

Cool, you make this too easy.  The debug file is exactly what I needed.  I had no idea what was going on and what variables where actually being sent.  Thank you for this, massive help.