'Declaration
Public Overloads Sub RepairDatabase()
'Usage
Dim instance As VistaDBConnection instance.RepairDatabase()
public void RepairDatabase()
'Declaration
Public Overloads Sub RepairDatabase()
'Usage
Dim instance As VistaDBConnection instance.RepairDatabase()
public void RepairDatabase()
Attempt to repair a partially corrupted database file by performing a pack operation with more tolerance for errors by dropping rows or tables which can not be successfully read rather than aborting the entire operation. Thus DATA LOSS CAN OCCUR despite apparent "success" of the repair. This operation is most successful at repairing corruption within indexes since they are simply dropped and recreated.
Always create a backup copy of the database before attempting a Repair. Once a RepairDatabase has completed (or progressed beyond a certain point) recovery of any lost data will not be possible without a backup from before the operation.
Constructs like constraints and triggers are ignored during a Repair and may be left in an invalid state requiring manual repairs to make them valid again and possibly then recreating the constraint once the data can pass.
Because of the potential for loss of data and schema and the need to check the resulting database before assuming a Repair was successful, a RepairDatabase should not be invoked automatically just because a PackDatabase failed. It could be provided as a user-triggered support option or performed offline as support for your clients.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2