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 2008 Forums
 Transact-SQL (2008)
 Export SQL table data to Excel 2007

Author  Topic 

itnagaraj
Yak Posting Veteran

70 Posts

Posted - 2013-03-25 : 08:57:32
I have run the below mentioned query to export the data -

insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\test.xlsx;HDR=YES',
'SELECT * FROM [SheetName$]') Select id,description,lookupCode FROM tblLookupMaster

But i am getting the below error-

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Unspecified 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)".



Kindly help.

V.NAGARAJAN

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-03-25 : 09:46:54
Check this link
http://blogs.msdn.com/b/spike/archive/2008/07/23/ole-db-provider-microsoft-jet-oledb-4-0-for-linked-server-null-returned-message-unspecified-error.aspx
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-03-25 : 09:48:04
For xlsx you should be using ACE provider

http://www.connectionstrings.com/excel-2007#ace-oledb-12-0

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -