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.