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
 Transact-SQL (2005)
 Insertiing rows in Excel

Author  Topic 

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2009-09-29 : 05:59:35
Hi All,

INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=e:\sample.xls;',
'SELECT MatchID,Time FROM [Sheet1$]')
SELECT top 10 MatchID,Time FROM TrendEvents Where MatchID = 6460 And SegmentID = 0
GO

The above is the code to insert rows into excel using OPENROWSET.
after executing the code i am getting below error.

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)".

How to resolve it??


Solutions are easy. Understanding the problem, now, that's the hard part

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-29 : 06:09:40
which is excel version you're trying to populate with?
Go to Top of Page

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2009-09-29 : 06:21:49
excel 2003

Solutions are easy. Understanding the problem, now, that's the hard part
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-29 : 06:22:08
Also make sure the EXCEL file is closed during the execution of the procedure
Refer this for more trouble-shooting
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan

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

- Advertisement -