Some data not being written through ASP since move to IIS 7/Server 2008 R2 RRS feed

  • Question

  • User-1474077999 posted
    I have a query that is returning a data set when ran through the SQL Server (2008)...but when I try to response.write it, it won't output. The weird part is that there's other data of the same type from the same query with all the same settings that's appearing. It worked perfectly fine before on IIS 6 (Server 2003). Any suggestions on where to start troubleshooting?
    Monday, August 20, 2012 1:37 PM

All replies

  • User-76669496 posted


    Classic ASP is not installed by default on Windows 2008. Ensure that it is enabled.


    Create a simple 1 line .asp page using response.write "hello world" to confirm at least that works.

    Monday, August 20, 2012 2:16 PM
  • User-1474077999 posted
    ASP works on this server. I'm well beyond Hell World :) The problem is that it is not returning the entire data set. Some fields are returned and be outputted using response.write, and yet there are fields of the same type that even though I try to output them w/ response.write they do not return anything. When I use len() it returns the fields as a length of 0. I'm not sure if it's something with the MDAC on the server or if it's ASP. Very frustrated with ASP on IIS 7 currently though. I'm getting ready to rewrite this app in PHP if I can't solve this issue soon.
    Tuesday, August 21, 2012 7:06 AM
  • User324387210 posted


    I have many webs and databases running on IIS 7/IIS 7.5 with SQL 2008 R2/ SQL 2008 Express / SQL 2005. Had never a problem with this. Try to output the SQL line (SELECT * FROM ...) wtith response.write. Then copy the SQL statement into the SQL Management Studio and see the result there. Got the right data?

    Maybe there are restrictions on the the single field?

    Try to run the same ASP page on the Browser on the server. Same results? (Sometime it shows the error)

    Try to use a trim(rs("field")).


    mySQL = "SELECT * FROM table WHERE id = " & id
    response.write mySQL
    set db = Server.CreateObject("ADODB.Connection")
    db.Provider = "sqloledb"
    db.Open = "Server=" & dbserver & ";Database=" & datenbank & ";UID=" & dbUID & ";PWD=" & dbpw & ";"
    set rs = db.Execute(mySQL)

    good luck 

    Monday, August 27, 2012 12:51 AM
  • User-176674611 posted

    Could you please provide the code snippet so that I could reproduce the issue locally?


    Monday, August 27, 2012 1:43 AM
  • User-1477460723 posted
    I've seen something similar for years, running an ASP application with SQL DB. It seems the order your retrieve the data is important. I make sure I have all the columns organised by type in the SELECT statement (all integers first, then varchar, then text) and then move all to variables in the same order.
    Wednesday, September 12, 2012 4:23 AM
  • User-607254929 posted

    Did you get to make this work ? I have a similar issue.

    Wednesday, October 31, 2012 1:15 PM