Help with registering control using VB.NET

Hi,

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:
conn.Open()

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"" ")
        '      
        conn.Open()

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

        conn.Close()
        Return ds

Open in new window


Thanks,
Victor
vcharlesAsked:
Who is Participating?
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.

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

http://www.microsoft.com/en-gb/download/details.aspx?id=13255
0
vcharlesAuthor Commented:
Hi,

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.

Thanks,

V.
0
ChloesDadCommented:
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?
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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

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.
0
vcharlesAuthor Commented:
It works.
Thank you for all the comments.
Victor
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.