Skip to content

Instantly share code, notes, and snippets.

@patcullen
Created May 27, 2014 06:36
Show Gist options
  • Save patcullen/f2ec6470d05708cbc53e to your computer and use it in GitHub Desktop.
Save patcullen/f2ec6470d05708cbc53e to your computer and use it in GitHub Desktop.
An example of connecting to an Excel file in ASP (using JScript)
<%@ 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();
});
%>
@patcullen
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment