Microsodt.ACE.Oledb.12.0; Error RRS feed

  • Question

  • Hi, 

    I am using vb2008 on Windows 8 64bit with Microsoft office Professional plus 2010 32 bit,

    I am keep getting this error while I am trying to compile my program.

    My program coding is as follows:

    Private Sub ebaysalefrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            myConnection = New OleDbConnection("Provider  = Microsoft.ACE.OLEDB.12.0; Data Source = Q:\VisualStudio\eBaySaleDir\eBaySale\eBaySale - Bound ComboBox\eBaySale - Bound ComboBox\bin\Debug\ebaysaletable.accdb")

            subjectCommand = New OleDbCommand("Select * from ebaysaletable", myConnection)

            myAdapter = New OleDbDataAdapter()
            myAdapter.SelectCommand = subjectCommand

            subjectTable = New Data.DataTable

            itemcombo.DataBindings.Add("DisplayMember", subjectTable, "ebaysaletable")


        End Sub

    I am hoping for best solution from you.

    Many Thanks


    Friday, January 25, 2013 7:28 PM

All replies

  • Hello,

    Can you tell us what the error message is and which line is causing the error when compiling?

    My guess is how you declared the subjectTable variable, try the code below. Look how the DataTable is setup. Also note you do not need an adapter and can use the using statement which will clean up those objects for you.

    Dim subjectTable As DataTable = New Data.DataTable
    Using myConnection = New OleDbConnection( _
        "Provider  = Microsoft.ACE.OLEDB.12.0;" & _
        "Data Source = Q:\VisualStudio\eBaySaleDir\eBaySale\eBaySale - " & _
        "Bound ComboBox\eBaySale - Bound ComboBox\bin\Debug\ebaysaletable.accdb")
        Using subjectCommand = New OleDbCommand("Select * from ebaysaletable", myConnection)
        End Using
    End Using
    itemcombo.DataBindings.Add("DisplayMember", subjectTable, "ebaysaletable")


    Saturday, January 26, 2013 10:48 AM
  • I'm going to guess that the error is related to locating the ACE OLEDB Provider. If you are running 64-bit Windows and 32-bit Office is installed then you need to set the Platform option (Build...Configuration Manager...) to x86. This will cause the app to run 32-bit and use the (installed) 32-bit ACE OLEDB Provider.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Monday, January 28, 2013 3:19 PM
  • Paul's response here is important.

    There are two different builds of the Microsoft Access Database Engine 2010 (the .ACE.OLEDB part in your provider name).  You stated you are using 64-bit development environment, but have 32-bit Office installed.  This will be your problem, as by default if you are in a build configuration with Any CPU as the desired output, it will default to 64-bit where possible.  In this case it is looking for a 64-bit version of the Access Database Engine to use, which you don't have installed, but you do the 32-bit.  Simply changing the Build > Configuration Manager's Platform option  to x86 will solve the problem in this instance.

    It is important to know which bit version of the Access Database Engine you will be using, as this error can often be confusing at first.

    I hope that helps clarify the answer a little more as to why this happens.

    Kind regards,

    Scott :)

    Tuesday, January 29, 2013 6:39 PM