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

  • Question

  • User-1831219222 posted

    I tried few things those found on google but no luck. (I already installed office driver form here: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23734)

    I have Win 7 Os (64-bit).

    Anybody know the solution for this problem ?

    Here is the code:

       Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim sourceFilename As String = "data.txt"
            Dim dt As New DataTable
            Using TextConn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" & _
                    "Data Source=" & Server.MapPath("") & ";" & _
                    "Extended Properties=""Text;HDR=Yes;FMT=Delimited;""")
                Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand("SELECT * FROM [" & sourceFilename & "]", TextConn)
                cmd.CommandType = CommandType.Text
                Dim da As New OleDb.OleDbDataAdapter(cmd)
            End Using
            GridView1.DataSource = dt
        End Sub
    Wednesday, July 13, 2011 1:10 PM


  • User-1831219222 posted

    Now, it did work when changed the target CPU from "Any CPU" to "x86".

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 13, 2011 4:47 PM