MSAccess连接错误 [英] MSAccess Connectivity Error

查看:65
本文介绍了MSAccess连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用64位Windows 7操作系统和在MS Access中插入记录,首先显示错误Microsoft.jet.OLEDB.4.0未在您的mashine中注册,因此我下载& instaled Microsoft Access数据库Engin



我写的代码为





< pre lang =c#> public Form1()
{
InitializeComponent();
myconn = new OleDbConnection( @ Provider = Microsoft.ACE.OLEDB.12.0;数据源= C:\ Users \ Raghavendra \ Document \ Exp1DB.accdb);
}

private void button1_Click( object sender,EventArgs e)
{
OleDbCommand cmd = new OleDbCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = @ 插入学生值(' + textBox3.Text + ',' + textBox1.Text + ',' + textBox2.Text + ');
cmd.Connection = myconn;
myconn.Open();
cmd.ExecuteNonQuery();
MessageBox.Show( 记录已插入 标题,MessageBoxButtons.OKCancel,MessageBoxIcon.Information);
myconn.Close();
}







现在它也显示错误为Microsoft.ACE.OLEDB.12.0没有注册你的mashine。 。



从下面的评论中复制的其他信息

不,我只有OFFICE11& OFFICE12,我没有OFFICE14

解决方案

按照本文档中的步骤 HOW TO:FIX ERROR - the' microsoft.ace.oledb.12.0'提供程序未在本地计算机上注册


如果您已尝试安装两个版本的引擎但没有成功,您最好检查一下您的计算机中提供了ACEOLEDB.DLL文件。您可以在Program Files \Common Files \ Micropros Shared \OFFICE14 \目录中查看该文件。如果它可用,那么尝试重新注册dll。


确保所有的位数:

- 你的应用程序

- 您的MS Access版本

- Ole提供商

是相同的(即所有这些都是32位或所有都是64位版本。)


I am using 64 bit Windows 7 OS & inserting a record in MS Access, at first it shown error Microsoft.jet.OLEDB.4.0 is not registerd in your mashine so I download & instaled Microsoft Access Database Engin

I wrote code as


public Form1()
        {
            InitializeComponent();
            myconn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Raghavendra\Documents\Exp1DB.accdb");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OleDbCommand cmd = new OleDbCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = @"insert into student values ('" + textBox3.Text + "','" + textBox1.Text + "','" + textBox2.Text + "')";
            cmd.Connection = myconn;
            myconn.Open();
            cmd.ExecuteNonQuery();
            MessageBox.Show("Record Inserted", "Caption", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            myconn.Close();
        }




now also it is showing error as Microsoft.ACE.OLEDB.12.0s not registerd on your mashine . .

additional information copied from comment below
no I have only OFFICE11 & OFFICE12 , i dont have OFFICE14

解决方案

Follow the steps in this document HOW TO: FIX ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine"


If you have tried with installing the both versions of engines and no success you better check whether the file ACEOLEDB.DLL is available in your computer. You may check with in "Program Files\Common Files\Microsoft Shared\OFFICE14\" directory for the file. If it is available then try with re-registering the dll.


Make sure that the bitness of all:
- your application
- your version of MS Access
- Ole Provider
is the same (i.e. either all of them are 32bit or all of them are 64bit version).


这篇关于MSAccess连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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