Good!
I am using Microsoft Access 2007 to do my practices at home together with JAVA and VB.NET. I ran the program that I had made in VB.NET when out of nowhere it reproaches me with the title message... I tried to re-download the database that I had in my cloud and replace it, but I get another error other than this:
And if I try to open the one I have in my JAVA project I get the following (the hateful message):
Try to reinstall the access database driver for the 2007 version, but the error persists. I read somewhere that the 32-bit version of this driver doesn't cause this problem, only the 64-bit one... but I'm currently using the 32-bit one.
Do you know the funniest thing of all? Is that when I run the JAVA version of the program, it runs normally as if nothing was happening. On the other hand, if I execute the version of the program in VB.NET, at once it sings me with the second error. The other databases that I have from other programs are working normally... only this database has given me this problem that I don't know how to solve. I thought about creating it all again, but it doesn't 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
Manager class (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 (I load 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 re-emphasize what happens:
I can't open the Hospital.accdb database in Microsoft Access 2007 itself (I get those error messages).
The program written in VB.NET does not recognize the database (it shows the same message as in the second image), while the JAVA version of the program works completely.
Try:
This solution is a bit lengthy, since you need two computers to do it:
I didn't really need to do much for JAVA either since I'm using UcanAccess and it doesn't depend on anything from Microsoft Access, but VB.NET does...