none
Visual Basic 2013 won't accept Microsoft.ACE.OLEDB.12.0 as a provider. RRS feed

  • Question

  • As stated in title the provider Microsoft.ACE.OLEDB.12.0 is not registered on the local machine and thus is causing some issues. Here is the code I am currently using, and the access format is in 2002-2003 on Visual Studio 2013 using Visual Basic language.

            connection.Close()
            provider = "Microsoft.ACE.OLEDB.12.0;Data Source=H:\Database_File_for_my_Database.accdb"

            connString = provider + dataFile
            connection.connectionstring = connString
            connection.Open()
            Dim str As String
            str = "Insert into Items([Title],[Author],[Price],[Reference Number]) Values (?,?,?,?)"
            Dim cmd As OleDbCommand = New OleDbCommand(str, connection)
            cmd.Parameters.Add(New OleDbParameter("Title", CType(txtTitle.Text, String)))
            cmd.Parameters.Add(New OleDbParameter("Author", CType(txtAuthor.Text, String)))
            cmd.Parameters.Add(New OleDbParameter("Price", CType(txtPrice.Text, String)))
            cmd.Parameters.Add(New OleDbParameter("Reference Number", CType(txtRefNo.Text, String)))

            Try
                cmd.ExecuteNonQuery()
                cmd.Dispose()
                connection.close()
                txtTitle.Clear()
                txtAuthor.Clear()
                txtPrice.Clear()
                txtRefNo.Clear()
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try

    Any help would be greatly appreciated.

    Friday, March 29, 2019 11:01 AM

Answers

  • Hello,

    Not knowing if you could ever work with MS-Access before

    Check  these settings, depending on if you have a 64 or 32 bit process can make the difference. Try the settings below. I have a GitHub repository on working with MS-Access and use these settings on a 64bit machine.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by YarpMeister21 Tuesday, April 2, 2019 10:34 AM
    Friday, March 29, 2019 11:23 AM
    Moderator