Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Repair Access MDB

200 views
Skip to first unread message

E.T.

unread,
Sep 30, 1998, 3:00:00 AM9/30/98
to
Can anybody tell me how can I repair Access database from BDE?

Brad Clarke

unread,
Sep 30, 1998, 3:00:00 AM9/30/98
to
E.T. wrote in message <36125d6c...@forums.inprise.com>...

>Can anybody tell me how can I repair Access database from BDE?
Since the Access libraries are on the target machine, you should be able to
do this via OLE automation and connect directly to the Access db engine and
access the "repair" functions directly.

How? I can't remember, as I haven't done any coding like that with
VB/Access since early 1996.

Brad
--
Brad Clarke
http://www.monisys.ca/~bclarke
Member of DCG Ottawa

Grant Walker

unread,
Oct 1, 1998, 3:00:00 AM10/1/98
to
Brad Clarke wrote:
>Can anybody tell me how can I repair Access database from BDE?

E.T. wrote:
>you should be able to do this via OLE automation

Brad Clarke wrote:
>How? I can't remember

The DBEngine object's CompactDatabase and RepairDatabase
methods are documented in ..\Microsoft Shared\DAO\DAO35.HLP.

The latest BDE Access driver may have dbi functions which call the
DAO methods, but I doubt it somehow. Automation is the way to do it.
I use Opus DirectAccess which makes it a cinch, but provided you have
an appropriate license (eg Access installed) you can create the engine
using ComObj helper CreateOleObject, then invoking the methods
off the resulting variant.

For advanced recovery see
ftp.microsoft.com/Softlib/MSLFILES/JET35UPD.EXE
ftp.microsoft.com/Softlib/MSLFILES/JETERR35.EXE


"Jetcomp.exe, which is included with Jet35upd.exe, is a standalone
utility that allows you to compact databases created with Microsoft Jet
database engine 3.x. This utility may be used in conjunction with
Microsoft Jet database engine 3.51 for recovering corrupted databases.
Although it is possible to use the Microsoft Access Compact utility or the
CompactDatabase method with Microsoft Jet database engine 3.51,
Jetcomp.exe may be able to recover some databases that these utilities
could not. This is because the Microsoft Access Compact utility and the
CompactDatabase method attempt to open and close a database before
attempting to compact it. In certain cases where these utilities may not
be able to reopen the database, Compact will be unable to proceed,
preventing recovery of the database. Jetcomp.exe does not attempt to
open and close the database before compacting, and may be able to
recover some databases that the Microsoft Access compact utility and
the CompactDatabase method could not. Jetcomp.exe is a freely
distributable utility, but requires that you have one of the following
products installed:
- Microsoft Office 97
- Microsoft Access 97
- Microsoft Visual Basic 5.0
- A Microsoft Office Developer Edition 97 run-time application that
includes the run-time version of Microsoft Access 97
- A Microsoft Visual Basic 5.0 run-time application that includes
Microsoft Jet database engine 3.5"


Woody

unread,
Oct 2, 1998, 3:00:00 AM10/2/98
to
If the DAO jet engine is installed (I presume it is) then you could
use the procedure I use that repairs and then compacts an Access
database:

procedure CompactDatabases;
var
dbEngine: Variant;

begin
if MessageDlg('Compacting the database requires ALL users
to'+chr(10)+
'be logged out of the program. Continue?',
mtConfirmation,[mbYes,mbNo],0) <> mrYes then
exit;
try
dbEngine := CreateOLEObject('DAO.DBEngine');
dbEngine.RepairDatabase(MyAccessDBName);
dbEngine.CompactDatabase(OldAccessName,NewAccessName,'',0,'');
except
on E: EOLEError do
ShowMessage(E.Message);
end;
end;
ShowMessage('Repair/Compact completed successfully.');
end;

One thing to keep in mind is that the CompactDatabase method requires
a different name than the one being compacted so you will have to make
sure that you copy or rename the new file back to the original name to
access it in your program.

Woody


E.T. wrote in message <36125d6c...@forums.inprise.com>...

Pierre du Parte

unread,
Oct 3, 1998, 3:00:00 AM10/3/98
to
Check out our msautil component (free with source) from
http://www.finalfiler.com/delphi

lj

unread,
Oct 3, 1998, 3:00:00 AM10/3/98
to
:Can anybody tell me how can I repair Access database from BDE?

const // DAO MSAccess Jet Engine constants
DAOMSJet = 'DAO.DBEngine.35'; // or may be 'DAO.DBEngine'

var
DBEngine: variant;
begin
try
DBEngine := CreateOleObject('DAO.DBEngine.35');
DBEngine.RepairDatabase ('d:\data\db1.mdb');
finally
dbengine := unassigned;
end;

end;

alfredp...@gmail.com

unread,
Jan 24, 2015, 6:48:22 AM1/24/15
to
Access File Recovery Software is an intelligent solution to fix all corruption issues in ACCDB and MDB database files and saves all the deleted records and objects like indexes, queries, relations and tables, on new database.


You can download it from:- http://www.filesrecoverytool.com/access-file-recovery.html

johnsonr...@gmail.com

unread,
Jan 31, 2015, 4:25:38 AM1/31/15
to
You can also try to use a very effective and affordable application for Access file Recovery from here:- http://www.recoverfilesdata.com/access-file-recovery-software.html
0 new messages