Microsoft.ACE.OLEDB.12.0未注册到本地机器
本文关键字:机器 注册 ACE OLEDB Microsoft | 更新日期: 2023-09-27 18:04:47
public partial class EnterData : Form
{
OleDbConnection myconn=new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:'Users'Buddiez'Documents'Visual Studio 2010'Projects'working with databse'working with databse'database.accdb");
public EnterData()
{
InitializeComponent();
}
private void EnterData_Load(object sender, EventArgs e)
{
}
private void btn_Save_Click(object sender, EventArgs e)
{
string connString = string.Format("insert into test_database values('{0}','{1}','{2}','{3}','{4}')", Convert.ToInt32(txtsno.Text), txtName.Text, Convert.ToInt32(txtage.Text), txtBackground.Text, txtAddress.Text);
OleDbCommand myConn = new OleDbCommand(connString, myconn);
try
{
myconn.Open();
myConn.ExecuteNonQuery();
MessageBox.Show("Entry Updated");
myconn.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
我已经将配置管理器配置到任何CPU,即使我面临同样的问题Microsoft.ACE.OLEDB.12.0没有注册到本地机器…指引我. .
听起来你需要安装Microsoft Access Database Engine 2010 Redistributable。这将安装所有必要的依赖项,以便Access OLEDB驱动程序正确工作。