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)
 OLEDB Issue in SQL Server 2008 Express Edition
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kalaiselvan
Yak Posting Veteran

India
83 Posts

Posted - 04/20/2012 :  01:53:22  Show Profile  Reply with Quote
Hi,
We are using Windows Server 2008 R2 server. And SQL Server 2008 Express Edition.
Facing OLEDB issue while Uploading an Excel in this server. Unable to fetch the record from Excel to Database.

Query:
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=D:\WebApplication\MSExcel.xlsx', 'SELECT * FROM [Sheet1$]')

Error:
OLE DB provider 'Microsoft.ACE.OLEDB.12.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.

Please help me to fix this issue. And provide us Suitable Query to Fix this.

Regards,
Kalai

visakh16
Very Important crosS Applying yaK Herder

India
47081 Posts

Posted - 04/20/2012 :  15:18:40  Show Profile  Reply with Quote
i think the issue is you try to run 32 bit excel running on 64 bit sql server.
can you try this?

http://blog.lekevin.com/computer/ole-db-provider-microsoft-ace-oledb-12-0-cannot-be-used-for-distributed-queries-because-the-provider-is-configured-to-run-in-single-threaded-apartment-mode/

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

Go to Top of Page

Kalaiselvan
Yak Posting Veteran

India
83 Posts

Posted - 04/23/2012 :  08:30:02  Show Profile  Reply with Quote
Thank u visakh.. My SQL Server is 64 bit and Excel is 32 bit. Have changed Microsoft Office to 2010. Now its working fine..

Regards,
Kalai
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47081 Posts

Posted - 04/23/2012 :  11:54:01  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
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.08 seconds. Powered By: Snitz Forums 2000