Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation ASP Ajax request to read XLS - Please Help!

    Hi im using ASP (html and javascript) and making a AJAX request which reads data from an XLS spreadsheet and returns a certain value. (see code below)

    It work fine in Firefox and Safari (windows) but doesnt work with IE 7.

    IE 7 says that the record set is either EOF or BOF but i cant seem to solve it.

    Any ideas?

    Thanks

    Connection
    Code:
    Set oConn = Server.CreateObject("ADODB.connection")
    oConn.Open "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;" &_
    "DBQ=D:\HTTP\*mywebsite*\website\ledcalc.xls;"
    AJAX asp page
    Code:
    <!--#Include file="connection.asp"-->
    response.expires=-1
    
    Set RS_wattage=Server.CreateObject("ADODB.recordset")
    RS_wattage.open "SELECT "+request.QueryString("t")+" FROM my_range WHERE LED = '"+replace(Request.QueryString("w"), "'", "''")+"'", oConn
    
    response.write(RS_wattage(""+request.QueryString("t")+""))

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    I would suspect that the problem lies in the AJAX call itself, rather the database connection code or the ASP page that the AJAX is calling.

    The way I'd debug it is to replace your response.write with a check for EOF / BOF and, if either, response.write your generated SQL string.

    As a note of caution - dropping querystring values directly into SQL statements without checking them for single-quotes, empty values or, say, a well-placed DROP TABLE statement, is very, very dangerous.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •