Solved

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine

Posted on 2011-02-23
2
1,079 Views
Last Modified: 2012-08-14
We have new machines that are now throwing this error:

Exception Message is:: Generic exception thrown at step:: DataAccessFunctions::getImportSpectSpreadsheet::Execute importss.  Exception Message is:: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

We have changed the platform in VS2005 to x86 and the issue occurs.

It works ok on WIndows XP with Office 2007 installed, however the error message above occurs when on windows 7 64 bit and Office 2010.

We have attempted and installed the Microsoft Access Database Engine 2010 Redistributable attempting to repair the issue.  Here is the code, it should be noted that we have attempted variations :

Provider=Microsoft.ACE.OLEDB.12.0, Extended Properties=Excel = 8.0
Provider=Microsoft.ACE.OLEDB.14.0, Extended Properties=Excel = 08.0
Provider=Microsoft.ACE.OLEDB.14.0, Extended Properties=Excel = 12.0




    Public Function importSS(ByRef filepath As String) As DataTable
        Try
            Dim strConnection As System.Data.OleDb.OleDbConnection

            Dim dsData As New DataSet
            Dim dt As New DataTable
            Dim objAdapter As System.Data.OleDb.OleDbDataAdapter

            strConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source='" & filepath & " '; " & "Extended Properties=Excel 8.0;")
            strConnection.Open()
            dt = strConnection.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, Nothing})
            objAdapter = New System.Data.OleDb.OleDbDataAdapter(String.Format("SELECT * FROM [{0}]", dt.Rows(0).Item("TABLE_NAME")), strConnection)
            Dim dt1 As New DataTable
            objAdapter.Fill(dt1)
            Return dt1
        Catch ex As Exception
            Throw ex
        End Try
    End Function

Thanks for any help you can provide
0
Comment
Question by:vdsIT
2 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34969304
I am not 100% sure, but if you have 2010, then you can't use the 12.0 library, you would need to use the 14.0 provider.  It might be possible to find the 12.0, if you start with the 14.0, and then let the probe find the correct version from there...

0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 35021661
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now