hansu
Programmer
- Mar 12, 2002
- 89
I want to provide the user with the possibility to compact an Access97 Database from the application.
Now I am stuck with the following problem:
When I run the following code error -2147467259 is generated: 'Couldn't open database. Either the database isn't recognized by the application or it is damaged' (Which is not the case)
Is that may be a problem of the MDAC version. And how do I check that?
Thanks for any help.
Now I am stuck with the following problem:
When I run the following code error -2147467259 is generated: 'Couldn't open database. Either the database isn't recognized by the application or it is damaged' (Which is not the case)
Code:
Dim jroEngine As JRO.JetEngine, strSourceDB$, strDestDB$
Set jroEngine = New JRO.JetEngine
strSourceDB = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Development\SmallBusinessApp\admindb.mdb;"
strDestDB = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Development\SmallBusinessApp\temp.mdb;"
If Dir(strDestDB) <> "" Then Kill (strDestDB)
jroEngine.CompactDatabase strSourceDB, strDestDB & ";Jet OLEDB:Engine Type=4"
Kill (strSourceDB)
Name "D:\Development\SmallBusinessApp\temp.mdb" As "admindb.mdb"
Err_Handler:
If Err.Number <> 0 Then Debug.Print Err.Number, Err.Description
Is that may be a problem of the MDAC version. And how do I check that?
Thanks for any help.