Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Using OLEDB 4.0 to read excel spreadsheet doesn't work on vista32

Reply
Thread Tools

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

 
 
David
Guest
Posts: n/a
 
      01-13-2009
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
 
Reply With Quote
 
 
 
 
David
Guest
Posts: n/a
 
      01-13-2009
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).

"Mark Rae [MVP]" wrote:

> "David" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> > "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.".

>
> This is a common error and, regrettably, occurs for a myriad of reasons. The
> main ones are that the workbook doesn't exist, the worksheet doesn't exist
> in the workbook, or that the account under which ASP.NET is running does not
> have sufficient permissions on the workbook.
>
> Without actually stepping through your code, it's almost impossible to know
> what's happening in your particular case.
>
> However, have you worked your way through these...?
> http://www.google.co.uk/search?sourc...ject+exists%22
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to read Excel file without Jet OleDB driver CS ADNT ASP .Net 1 10-16-2009 06:53 AM
GridView exported to Excel can't be read using OleDb mohaaron@gmail.com ASP .Net 0 11-07-2007 12:19 AM
HP Dv9000z with vista32 Howard Huntley Windows 64bit 1 04-03-2007 05:34 PM
Can't Read Excel File (OleDb) w/ ASP.NET Impersonation cmay ASP .Net 0 04-12-2005 11:23 PM
System.Data.OleDb.OleDbException: Could not find installable ISAM : Read Excel Spreadsheet in web-form Roger Twomey ASP .Net 1 04-27-2004 09:12 PM



Advertisments