Jump to content

Reading Excel in ASP


Lee-yoshi

Recommended Posts

Hello (Again)!I'm trying to read data from a Excel file (And then import it into SQL databases) however the pages refuse to open the Excel file at all!I have tried a few different ways:

DConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _			   "Data Source=" & Server.MapPath("Test.xls") & ";" & _			   "Extended Properties=""Excel 8.0;HDR=No"""

which produces the error below------------------------------------------------------------------------------------Microsoft JET Database Engine error '80004005' Could not find installable ISAM. ------------------------------------------------------------------------------------I've also tried this:

DConnection.Open "DBQ=" & Server.MapPath("Test.xls") & ";" & _	"Driver={Microsoft Excel Driver (*.xls)};"

which gives me this error:------------------------------------------------------------------------------------Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x1978 Thread 0x11ec DBC 0x2b796f84 Excel'. ------------------------------------------------------------------------------------And also just tried a simple option:

DConnection.Open( Server.MapPath("Test.xls") )

No joy there either------------------------------------------------------------------------------------Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name too long ------------------------------------------------------------------------------------What am i missing here?! Warning: I am an idiot.Any help appreciated, google is failing me :)

Link to comment
Share on other sites

  • 3 weeks later...

Is this just a one off routine to take the data from an XLS file to insert into the SQL db?If so then surely it's easier to open the SQL using access and then import the XLS.

Link to comment
Share on other sites

Thanks for replying!The problem for me is that it needs to be done in Internet Explorer. If it's possible to do it through converting the file in IE first from .xls to .mdb/.accdb format and then uploading it that way (Which i can do!) then that would also be suitable but i've no idea if you can or not. I don't understand why i'm receiving any of these errors anyway if other people are managing just fine :/ I'm still very much confused on the matter!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...