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)
 OLEDB Issue in SQL Server 2008 Express Edition

Author  Topic 

Kalaiselvan
Posting Yak Master

112 Posts

Posted - 2012-04-20 : 01:53:22
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

52326 Posts

Posted - 2012-04-20 : 15:18:40
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
Posting Yak Master

112 Posts

Posted - 2012-04-23 : 08:30:02
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

52326 Posts

Posted - 2012-04-23 : 11:54:01
welcome

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

Go to Top of Page
   

- Advertisement -