I am attempting to import data into from an excel file into an application using asp. My code is as follows
HTML Code:
<%
'Routines for fetching excel file from file system
Dim conn
Dim rs
Dim file
Dim arrResultSet
Set file = request.form("excelFile")
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.recordset")
Dim connString
Dim sql
connString = "DRIVER={Microsoft Excel Driver (*.xls)};DBQ=" & file &"; ReadOnly=0"
conn.Open connString
sql = "Select * FROM [sheet1$];"
rs.Open sql, conn
%>
I am using an excel file on my laptop and not on the server - the requirements for this work are that the user is able to import data from their local machine.
The following error is being returned....
Quote:
OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Excel Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
/mediabin/MapMetadata2.asp, line 131
|
The following is line 31 -
connString = "DRIVER={Microsoft Excel Driver (*.xls)};DBQ=" & file &"; ReadOnly=0"
Any help would be appreciated.