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 2000 Forums
 Transact-SQL (2000)
 get data from an excel file

Author  Topic 

-fred-
Starting Member

5 Posts

Posted - 2004-08-16 : 02:54:23
how can i get data froma n excel file using select statements/openrowset/opendatasource?

i can't seem to get the data from this code:


SELECT *
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',"EXCEL 8.0; database ='C:\Documents and Settings\fred.l.dellosa\Desktop\list_billno_vat.xls'",
'select * from [sheet 2$]')


it returns me an error:
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. The provider did not give any information about the error.

what does it mean?
thanks in advance..

Kristen
Test

22859 Posts

Posted - 2004-08-17 : 07:20:03
Blinking useless isn't it.

Debugging this type of stuff takes far FAR too long.

I put a

@intDebug int = 0

parameter on my SProcs so I can get some detailed diagnostic data when I need it. Why can't Microsoft upt something similar in OPENROWSET - it deffo. needs it in my experience. And the stuff for trying to create a Linked Server. And a bunch more.

Other than sympathy I can't help - sorry!

Kristen
Go to Top of Page

samsekar
Constraint Violating Yak Guru

437 Posts

Posted - 2004-08-17 : 07:26:38
I think it is because the excel file is kept open.. close it and try again.

- Sekar
Go to Top of Page
   

- Advertisement -