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
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