Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Excel

Author  Topic 

brishanny
Starting Member

1 Post

Posted - 2008-08-21 : 18:04:50
I am trying to access an Excel file from a couple different worksheets using SQL 2000 and 2005.

I can run the query fine for some files but not the others. I am currently tesing this so i have one column of data. What could cause the excel file to be corrupt or in a format that can not be recogonized by jet. I am using excel 2003 and service packs are up to date on the server.

For instance, the below works but the second one does not. They have the same data.

The only difference is...the first one was created from a new workbook. The second one was created from an existing workbook. On the second one, i even deleted all the existing worksheets and created a new one. I get the same error. The error is at the bottom of the post.


SELECT * FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=\\djc-filesrv\shared_files\groups\analysts\test\Book10.xls',[Sheet1$])

SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=\\djc-filesrv\shared_files\groups\analysts\test\Book1.xls',[Sheet1$])

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-21 : 18:11:30
The Script Library forum is for working solutions, not to start threads with questions. I will your thread.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-22 : 03:40:38
Make sure the file is closed when you run the query
Also go thru this link
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -