Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-1999, 08:50 PM
N/A
Guest
 
Posts: n/a
Default How to repair a corrupted MS Access Db ?

I'd like to know if there is a way to repair a Db like MS Access does using Delphi.



Thanks.
Reply With Quote
  #2  
Old 09-23-1999, 03:13 AM
N/A
Guest
 
Posts: n/a
Default RE: How to repair a corrupted MS Access Db ?

(in Delphi 3) You must to include a type library --> PROJECT --> IMPORTE TYPE LIBRARY --> SELECT MS DAO 3.5 (IF YOU WORK UNDER MS-ACCESS 97 OR DAO 3.0 IF YOU WORK UNDER MS-ACCESS 95).



This action causes your in your project to include an unit called 'DAO_TLB', this unit have all necessary to access the DAO objects.



Example:



*uses dao_tlb *// of course

*...

*var

* * ENGINEBENGINE;

* * DBPRUEBAATABASE;

* * DIREC,ORIGEN:STRING;

*...



* ENGINE:=CODBENGINE.CREATE;

* DBPRUEBA:=ENGINE.OpenDatabase(origen,TRUE,TRUE,';P WD=PIZF');

* * *ENGINE.RepairDatabase(ORIGEN);

* * *DELETEFILE(PCHAR(DIREC+'PEPE.MDB'));

* * *ENGINE.COMPACTDATABASE(ORIGEN,DIREC+'PEPE.MDB','' ,dbversion30,'');



...



// You must to ensure that nobody is in the DB
Reply With Quote
  #3  
Old 09-24-1999, 08:33 PM
N/A
Guest
 
Posts: n/a
Default RE: RE: How to repair a corrupted MS Access Db ?

Thanks, it worked.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:38 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.