SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Export SQL table data to Excel 2007
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

itnagaraj
Yak Posting Veteran

India
69 Posts

Posted - 03/25/2013 :  08:57:32  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2224 Posts

Posted - 03/25/2013 :  09:46:54  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 03/25/2013 :  09:48:04  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000