Hi,
I am writing code for connecting to an access database in my windows 7 machine. Am using visual studio 2010 with access 2007. While debugging the code am getting the exception "The 'Microsoft.Jet.OLEDB.4,0' provider is not registered on the local machine".
Below is my code,

 Try
            connection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4,0;Data Source=G:\Kothai\Tools\Database\ChurchDB.mdb;")
            connection.Open()
            command = New OleDbCommand("Select * from Login", connection)
            Reader = command.ExecuteReader()
            While Reader.Read
                If (txtusername.Text = Reader(0) And txtpwd.Text = Reader(1)) Then
                    MessageBox.Show("Login Successfull")
                Else
                    MessageBox.Show("Login Not Successfull")
                End If
            End While
        Catch ex As Exception


        End Try

while browsing i found that i need to install "Microsoft Access Database Engine 2010 Redistributable". Currently i have access 2007 for intalling the above, whether i need to uninstall the whole microsoft office or is there any other way to overcome this?

Recommended Answers

All 4 Replies

You don't need Office to access the provider, just the redistributable.

Thanks, But while am attempting to install Microsoft Access Database Engine 2010 Redistributable it shows message "already another version of MS Office is installed please uninstall and try".

Please help me with the above error

Are you currently running Windows 7 64-bit?

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.