View Full Version : ASP Ajax request to read XLS - Please Help!

11-29-2007, 01:11 AM
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?



Set oConn = Server.CreateObject("ADODB.connection")
oConn.Open "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;" &_

AJAX asp page

<!--#Include file="connection.asp"-->

Set RS_wattage=Server.CreateObject("ADODB.recordset")
RS_wattage.open "SELECT "+request.QueryString("t")+" FROM my_range WHERE LED = '"+replace(Request.QueryString("w"), "'", "''")+"'", oConn


11-30-2007, 05:58 PM
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 (http://www.google.co.uk/search?q=SQL+Injection+attack), is very, very dangerous.