2013-05-01 77 views
0

經過幾個小時的搜索並空了,我決定尋求額外的幫助。Microsoft.ACE.OLEDB.12.0錯誤

我運行以下命令

select * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 
12.0;Database=C:\SAMPLE.xlsx;HDR=YES', 'SELECT * FROM [sheet1$]') 

我收到正常的錯誤其他人都接收。

Msg 7399, Level 16, State 1, Line 1 
The OLE DB provider "Microsoft.ACE.OLEDB.12.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 1 
Cannot initialize the data source object of OLE DB provider 
"Microsoft.ACE.OLEDB.12.0" for linked server "(null)". 

目前我正在運行Windows Server 2003 R2的64位和使用Windows Office 2007的,我下的管理帳戶運行,所以我知道這沒有用,我已經看到了TEMP權限問題做。

sp_configure 'show advanced options', 1; 
RECONFIGURE; 
sp_configure 'Ad Hoc Distributed Queries', 1; 
RECONFIGURE; 
GO 

USE [master] 
GO 
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1 
GO 
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1 
GO 

已經運行。

起初,我得到的錯誤,當我嘗試其他命令,它開始掛斷我,我通過添加-g512;在啓動參數前,並解決了問題。但是,現在我回到了原來的錯誤。

我已經卸載並重新安裝了訪問驅動程序,這也沒有幫助。任何建議將不勝感激。

+1

是您的表真的叫 「單」?我會期望「Sheet1」或某個數字。 – 2013-05-01 14:50:10

+0

調整後,它是Sheet1。 – 2013-05-01 15:26:59

回答

0

試試這個:

SELECT 
* 
FROM 
OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0','Data source = "C:\SAMPLE.xlsx"; Extended proprietes="Excel 12.0";HDR=YES;IMEX=1;')...[sheet1$] 
相關問題