.net 我该如何解决“OLE DB 提供程序“Microsoft.Jet.OLEDB.4.0”尚未注册。”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3020920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how can i solve "The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered."?
提问by Penguen
i try to use get excel data from excel file. i am using office 2007 and sql 2005. i writed below codes:
我尝试使用从 excel 文件中获取 excel 数据。我使用的是 office 2007 和 sql 2005。我写了下面的代码:
CREATE TABLE [dbo].[Addresses_Temp] (
[FirstName] VARCHAR(20),
[LastName] VARCHAR(20),
[Address] VARCHAR(50),
[City] VARCHAR(30),
[State] VARCHAR(2),
[ZIP] VARCHAR(10)
)
GO
INSERT INTO [dbo].[Address_Temp] ( [FirstName], [LastName], [Address], [City], [State], [ZIP] )
SELECT [FirstName], [LastName], [Address], [City], [State], [ZIP]
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Source\Addresses.xls;IMEX=1',
'SELECT * FROM [Sayfa1$]')
Error:Msg 7403, Level 16, State 1, Line 2 The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered.
错误:消息 7403,级别 16,状态 1,第 2 行 OLE DB 提供程序“Microsoft.Jet.OLEDB.4.0”尚未注册。
我该如何解决?回答by Michael
If you are running the SSIS package from the SQL Agent job then in the step properties after you have picked the ssis package from the MSDB or file system, go to the Execution Options tap and check the Use 32-Bit runtime option.
如果您从 SQL 代理作业运行 SSIS 包,则在从 MSDB 或文件系统中选择 ssis 包后的步骤属性中,转到“执行选项”并选中“使用 32 位运行时”选项。
Worked for me.
对我来说有效。
回答by codingbadger
For 32-bit SQL Server you will need to install manually as the drivers are not included from MDAC 2.6 onwards. They can be downloaded here
对于 32 位 SQL Server,您需要手动安装,因为从 MDAC 2.6 开始不包含驱动程序。它们可以在这里下载
For 64-bit SQL Server I am afraid this is no longer possible. The Jet Engine drivers were not ported to 64-bit and they don't appear to be ported in the future. You can import the Excel document using SSIS but not using the OpenRowSet query. There is another option herebut it does seem a some what laborious process
对于 64 位 SQL Server,恐怕这不再可能。Jet Engine 驱动程序未移植到 64 位,而且将来似乎也不会移植。您可以使用 SSIS 导入 Excel 文档,但不能使用 OpenRowSet 查询。这里还有另一种选择,但似乎确实是一个费力的过程

