I am trying to use an existing access db file with my c# app. When I try to connect, it says that:
"The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine."

How do I register it/install it/whatever it is I need to do to make it work?

Thanks.

I have Visual Studio 2008 with SQL Server 2005 Express installed if that helps.

Recommended Answers

All 3 Replies

You realize that the connection string format is not the issue right? I know how to format the string, it just can't find the provider.

Um...

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

Or in the case of one system I work on:

Data Source=HQNVSQL07;Initial Catalog=dxBugsDb;User Id=******;Password=******;

This is of course using System.Data.SqlClient.SqlConnection objects.

example:

using ( System.Data.SqlClient.SqlConnection = new System.Data.SqlClient.SqlConnection(@"Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;") ) {
// DO WORK
}

As you can see, if it's SQL Server then you don't need a Provider.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.