corrupt access database: "Unrecognized Database Format"

1

Good!

I am using Microsoft Access 2007 to do my practices at home with JAVA and VB.NET. I ran the program that I had done in VB.NET when out of the blue reproaches me with the message of the title ... I tried to download the database I had in my cloud and replace it, but I get another error other than this one:

And if I try to open the one I have in my project in JAVA I get the following (the hateful message):

Try reinstalling the access database driver for the 2007 version, but the error persists. I read that the 32-bit version of this driver does not cause this problem, only the 64 ... but I'm currently using the 32.

Do you know the funniest thing of all ?, is that when I run the program version in JAVA, it runs normal as if nothing was happening. On the other hand, if I run the version of the program in VB.NET, at once it sings to me with the second error. The other databases that I have of other programs if they are working normal ... only this database has given me this problem that I do not know how to solve. I thought about creating everything again, but I do not even let me import data or see the relationships ...

How could I solve this heavy problem?

Update

Upon request I leave the code of both connections, both in VB.NET and in JAVA:

VB.NET

Module ModuleH
    Friend conexion As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Hospital.accdb;Persist Security Info=False;")

    Friend Sub ConectarBD()
        Try
            conexion.Open()
            MsgBox("Pulse aceptar para confirmar la carga de datos.")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        conexion.Close()
    End Sub
End Module

JAVA

Class manager (Here I initialize the UcanAccess driver and the DB address)

public class GestorDB {
private Connection conn;
private final String driver;

public GestorDB(String direccionDB) throws ClassNotFoundException, SQLException{
    driver = "net.ucanaccess.jdbc.UcanaccessDriver";
    Class.forName(driver);
    conn = DriverManager.getConnection("jdbc:ucanaccess://"+direccionDB);
}

public Connection getConnection(){
    return conn;
}

Administrator class (Charge the address of the DB)

public class Administrador {
private GestorDB gestor;
private String idActual;

public Administrador() throws ClassNotFoundException, SQLException{
    gestor = new GestorDB("*******SaludParaTodos\src\Hospital.accdb");
    idActual = "";
}    

public Connection obtenerConexion(){
    return gestor.getConnection();
}

I'll highlight again what happens:

  • The Hospital.accdb database can not be opened in the same Microsoft Access 2007 (I get those error messages).

  • The program written in VB.NET does not recognize the database (It sends the same message of the second image), while the version of the program in JAVA does work completely.

asked by TwoDent 12.12.2016 в 00:49
source

2 answers

2

Try:

  • Open Microsoft Access and select the "compact and repair the database" .
  • Try opening your database with another version of Access (Example ms-access 2010 or higher versions).
  • Your computer may not have the data connection components; In this case, I recommend installing 2007 Office System Driver: Data Connectivity Components .
  • answered by 19.12.2016 / 22:18
    source
    1

    This solution is a bit extensive, since you need two computers to do it:

  • As you can see, the problem of the corrupt database started on a machine with Microsoft Access 2007 . First take a copy of the corrupted database and save it to a USB.
  • Following the different solutions that Mauricio left, especially the number 2 ... use a second machine with Access 2013 to open the corrupt BD. If I tried to visualize the tables and columns, it was not possible for me, but if I let use the option of import Access database .
  • Create a new database on the second machine ( Access 2013 ).
  • Use the import Access database option.
  • On the first machine with Access 2007 , I made two copies: One DB for VB.NET and one for JAVA (So far I would fix everything for VB.NET ).
  • For the Access DB to run well in JAVA you would first need to select the option to compact and repair , because if you paste the DB as it was, errors will appear in Regarding the Indexing of the columns.
  • I really did not need to do much for JAVA either, since I'm using UcanAccess and it does not depend on anything from Microsoft Access, but instead VB.NET if ...

        
    answered by 02.03.2017 в 16:26