Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving Excel data with ASP

Status
Not open for further replies.

stlWebWiz

Technical User
Mar 7, 2005
12
0
0
US
Hello,

I'm wanting to display information from an excel spreadsheet on an ASP webpage. I know its not usually a good idea to use excel as a datasource but I'm only using it to display. I know ASP is capable of retrieving info from an Excel spreadsheet, but I have know idea what the code would look like.

Any help/code snippet would be greatly appreciated

STLWW
 
Do you want Excel to open in the browser like what happens if you drag the icon for an excel file and drop it into the browser window?

Or do you want to read data from the file and then format it as an HTML page?
 
here you go

Code:
Set conn = CreateObject("ADODB.Connection")
conn.ConnectionString =  "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq="& server.mappath("MyExcel.xls") & ";"
conn.Open()


sql="SELECT * FROM [sheet1$]"
conn.execute(sql)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top