0

his is my code developed with c # and it does not connect me to the database dont know why, i am using everything correctly, the error is The provider 'Microsoft.Jet.OLEDB.4.0' is not registered on the local computer.

enter code here
static public void conectar()
    {
        try {

            string gsPatchUbicar = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            gsPatchUbicar = gsPatchUbicar.Substring(6);
            DireccionBD = gsPatchUbicar + "\\db_deportes.mdb";
            string stringconeccion = string.Format(@"PROVIDER=Microsoft.Jet.OLEBD.4.0;Data Source={0}; Jet OLEBD:Database Password={1}", DireccionBD, PasswordBD);
            getConexion = new OleDbConnection(stringconeccion);
            getConexion.Open();
            MessageBox.Show("Conexion a base de datos exitosa!!", "ok", MessageBoxButtons.OK, MessageBoxIcon.Information);
        } catch (Exception H)
        {
            MessageBox.Show("hay un error en la conexion de base de datos");
        }

    }
  • 1
    Does this answer your question? [Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine](https://stackoverflow.com/questions/1991643/microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine) – Ken White Jun 02 '20 at 01:16
  • go to this link address [Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine](https://stackoverflow.com/questions/1991643/microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine) – هادی کشاورز Hadi Keshavarz Jun 02 '20 at 03:41

1 Answers1

0

There is indeed no 64 bit version of Jet - and no plans (apparently) to produce one.

You might be able to use the ACE 64 bit driver: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=23734[^] - but I have no idea how that would work if you need to go back to Jet for your 32 bit apps.

However, you may be able to switch the project to 32bit in the Express version (I haven't tried and don't have 2008 installed in any flavour anymore) - there is a thread here that talks about it: http://xboxforums.create.msdn.com/forums/t/4377.aspx#22601[^]

Maybe it's time to scrap Access databases altogether, bite the bullet and go for SQL server instead?