Help with registering control using VB.NET


I am using the code below to transfer data from an excel file to a dataset, but receiving error message: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
on line:

How do I register the 'Microsoft.ACE.OLEDB.12.0' provider?

Private Function makeDataTableFromSheetName() As DataSet
        Dim ds As DataSet = New DataSet()
        Dim DestinationPath As String = IO.Path.Combine(Application.StartupPath + "\AOP40SC1.xls")

               Dim Conn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; " & "data source='" & DestinationPath & "';" & "Extended Properties=""Excel 12.0;HDR=YES;IMEX=1"" ")


        ' conn = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; " & "data source='" & DestinationPath & "';" & "Extended Properties=""Excel 12.0;HDR=YES;IMEX=1"" ")

        Dim dt As New DataTable()
        adap = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", conn)

        Return ds

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You need to install the Microsoft Access Database Engine 2010 Redistributable
vcharlesAuthor Commented:

I used the same code in another application developed in the sane PC and it works, I think something  is missing in the current application.


Are you running it as 32 bit (x86) or 64bit (x64). Is this the same for the other program. What version of VB are you using?
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

vcharlesAuthor Commented:
I am running ir as 32bit, using VS2010.
Éric MoreauSenior .Net ConsultantCommented:
Try to switch from "Any CPU" to X86 to force it to use the 32-bits version.
vcharlesAuthor Commented:
Where in the application  do I make this change?
Éric MoreauSenior .Net ConsultantCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vcharlesAuthor Commented:
Thanks. Will get back to you.
vcharlesAuthor Commented:
It works.
Thank you for all the comments.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.