Hi all. I want to export data from excel 2003 to sql server 2005. I am using the following script:
EXECsp_configure'show advanced options', 1;
GO
RECONFIGURE;
GO
EXECsp_configure'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
Insertinto Pamphlet
Select*FROMOPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Pamphlet.xls;HDR=YES',
'SELECT * FROM [Sheet3$]')But it is giving the following error:
Msg 7399, Level 16, State 1, Line 2
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 2
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
The above script is working fine with Excel 2002 but not with 2003. Can someone please provide me exact script of importing data from excel 2003 to sql server 2005. I have also tried the Linked server option but it is still giving the same error.
Please help me.
Please make sure the file path is correct and MS Excel 2003 is closed.
Checkout these links as well:
http://sqljunkies.com/WebLog/madhivanan/archive/2005/07/27/16233.aspx
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926&whichpage=4
Good luck.
No comments:
Post a Comment