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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connecting to excel

Status
Not open for further replies.

rjhilliard

Programmer
Mar 7, 2007
1
US
I am trying to open a connection to an excel spreadsheet that resides on a network using classic asp.
I have had success connecting locally but I must not be entering the correct parameters for a network connect.
Here is my code:

objConn2.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\server name\root directory\subdirectory\subdirectory\spreadsheet.xls;""Extended Properties=Excel 8.0;HDR=Yes"""

I have also tried...
objConn2.ConnectionString="Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=" & Server.mappath("/"&"spreadsheet.xls") & ";UID=admin;"

also tried this...

objConn2.ConnectionString="Driver={Microsoft Excel Driver (*.xls)};DriverId=790;DBQ=\\server name\root directory\subdirectory\subdirectory\spreadsheet.xls;DefaultDir=\\server name\root directory\subdirectory\subdirectory\

I tried supplanting the ip address for server name without luck.

I am currently receiving this error...

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Excel Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x900 Thread 0x268 DBC 0x10dbf04 Excel'.

Any help would be appreciated.
 
Two initial thoughts: either your file isn't where you are trying to link to or Excel may not be loaded on the server.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top