Created
May 27, 2014 06:36
-
-
Save patcullen/f2ec6470d05708cbc53e to your computer and use it in GitHub Desktop.
An example of connecting to an Excel file in ASP (using JScript)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Language=JScript %> | |
<!--#include file="excel.asp" --><%/* https://gist.githubusercontent.com/patcullen/096a79ca8000b367537e/raw/7a806439bdf388335f2403ba89d8f51f039fb6a8/excel.asp */%> | |
<!--#include file="json.asp" --><%/* https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js */%> | |
<% | |
excelFile = "c:/temp/unlocodes.xlsx" | |
sql = "SELECT [ISO 3166-1], [Country Name] FROM [Sheet1$]" | |
excel.open(excelFile).query(sql, {}, function(codes) { | |
Response.write( | |
JSON.stringify(codes.asArray()) | |
); | |
excel.close(); | |
}); | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I Google'd that and the first few results related to filesystem or OS permissions related to the source of data. I'd suggest you Google it yourself and work through the first page of results. That's usually what I do. I haven't touched the ASP environment in almost 6 years, so can't give much better advice.