Using OLEDB 4.0 to read excel spreadsheet doesn't work on vista32

D

David

Hi - i have coded a page that opens an excel spreadsheet using oledb and it
works fine when i run it on an XP environment but on vista 32 it opens the
spreadsheet but cannot find the sheet (ie: table). keep getting Message =
"The Microsoft Jet database engine could not find the object 'schedule$'.
Make sure the object exists and that you spell its name and the path name
correctly.". The path is correct, the sheet name is correct. Again, works on
XP but not Vista. tks.

code

Protected Function GetDivision() As Data.OleDb.OleDbCommand

' Connect to the Excel Spreadsheet
Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("schedule.xls") & ";" & _
"Extended Properties=Excel 8.0;"
' create your excel connection object using the connection string
Dim objXConn As New Data.OleDb.OleDbConnection(xConnStr)
Dim sqlStr As String = "SELECT DISTINCT [Div] FROM [schedule$] order
by [Div]"
objXConn.Open()

Dim objCommand As New Data.OleDb.OleDbCommand(sqlStr, objXConn)
Return objCommand

End Function
 
D

David

Thanks for your prompt reply. i did peform numerous searches prior posting
and found nothing that helped. my web site environments are identical on XP,
as Vista and the workbook and sheet definitely exist. As well, on Vista i am
running under admin. The interesting thing is that the connection/cmd.state =
1 (Open).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top