如何解决此错误'microsoft.ace.oledb.12.0'提供程序未在本地计算机上注册。 [重复] [英] How do I resolve this error the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine.' [duplicate]

查看:181
本文介绍了如何解决此错误'microsoft.ace.oledb.12.0'提供程序未在本地计算机上注册。 [重复]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要为我使用的Provider = Microsoft.ACE.OLEDB.12.0导入.txt制表符分隔文件,但是当我运行我的项目时,我收到此错误

To import a .txt Tab delimited file for that I used Provider=Microsoft.ACE.OLEDB.12.0, but when I run my project I get this error

"The Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.




I install AccessDataBaseEngineX64 file, but still getting error. Error getting me in Con.open() line.i am appyling all solutions but still getting same error plz read carefully and give me the solution. and my Configuration is WINDOWS 10 64 bit and Day before yesterday i install WINDOWS 10.





我尝试过:





What I have tried:

public void ImportTxtFile(string filename)
    {
        FileInfo file = new FileInfo(filename);
        string path = @"E:\\TxtFile";
        using (OleDbConnection con =
        new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + @";Extended Properties='text;HDR=YES;FMT=TabDelimited';"))
        {
            using (OleDbCommand cmd = new OleDbCommand(string.Format
            ("SELECT * FROM [{0}]", file.Name), con))
            {
                con.Open();

推荐答案

检查两件事:

1)您的应用是针对x86还是x64编译的?如果它是为x86编译的,那么你就无法访问64位Access驱动程序(或任何其他64位代码)。

2)检查你安装的ACE引擎的版本:V12与Office有关2007版本,V14是Office 2010.您的连接字符串专门引用了2007版本。

这可能有所帮助:简单的SQL连接字符串创建 [ ^ ]


检查控制面板 - >用于查看已安装Microsoft Office Access数据库引擎的程序。
Check Control Panel -> Programs to see that you have "Microsoft Office Access database engine" installed.


这篇关于如何解决此错误'microsoft.ace.oledb.12.0'提供程序未在本地计算机上注册。 [重复]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆