Not registered error message

P

pgonza02

Hi,
I am trying to deploy a really simple application built on Visual Studio
2008 using framework 3.5 that consumes an Access 2007 database.
When I deploy it and run my app, I get the following error:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine

Here is the code that's causing the error:
private void ConnectToDB()
{
try
{
if (_dbConnection.State != ConnectionState.Open)
{
_dbConnection.ConnectionString =
global::MCIS0685.Properties.Settings.Default.MCIS0685DBConnectionString;
_dbConnection.Open();
}
}
catch(Exception ex)
{
MessageBox.Show("Unable to connect to database. Error:\n" +
ex.Message,
"Database Connect", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
The connection variable is defined as:
private OleDbConnection _dbConnection = new OleDbConnection();

This is the configuration file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="MCIS0685.Properties.Settings.MCIS0685DBConnectionString"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=MCIS0685DB.accdb"
providerName="System.Data.OleDb" />
</connectionStrings>
</configuration>

The DB file is in the same folder as the executable assembly.

Any ideas?
TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top