Tôi nhận được lỗi sau khi cố gắng mở một file Excel trong SQL Server 2008 r2 64-bit:Excel vào SQL Server với Microsoft.ACE.OLEDB.12.0
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)".
Tôi đang sử dụng truy vấn sau:
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;
HDR=NO; IMEX=1; Database=\\filepath\filename.xlsx', 'SELECT * FROM [Sheet1$]')
Điều thú vị là DBA có thể chạy nó mà không gặp sự cố. Tôi đã xem xét và chạy các truy vấn sau:
sp_configure 'Show Advanced Options', 1;
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO
EXEC sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1
GO
EXEC sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1
GO
Tài khoản chạy có vẻ như có quyền truy cập sa. Điều gì có thể gây ra vấn đề này?
làm tài khoản dịch vụ máy chủ sql có đủ quyền để đọc '\\ filepath \ filename.xlsx'? – shibormot
Bạn có thể thực hiện truy vấn này: ** exec master..xp_cmdshell 'dir \\ filepath \' ** –
Có một số gợi ý ở đây, FYI: http://granadacoder.wordpress.com/2010/12/07/ bug-in-documentation-microsoft-access-database-engine-2010-redistributable/ – granadaCoder