Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Corrupt Access 97 database

Status
Not open for further replies.

Katriona

Programmer
Aug 29, 1999
24
AU
I have an Access 97 database that is corrupt and cannot be repaired when prompted to repair on start up. Does anyone know if there is a way to save it?
 
The following code is straight out of the ACCESS 97 help file, you might try to use it from inside another database, just change the name of the database from Northwind to your own.&nbsp;&nbsp;If it doesn't solve your problem, you will probably have to create a new database and import each object one at a time.&nbsp;&nbsp;You should get an error message when you attempt to import the object that is corrupted, and will have to rebuild it. I've never had to do this, but I've read elsewhere about this advice on importing one at a time.&nbsp;&nbsp;&nbsp;Good Luck<br><br>This example attempts to repair the database named Northwind.mdb. You cannot run this procedure from a module within Northwind.mdb.<br><br>Sub RepairDatabaseX()<br><br> Dim errLoop As Error<br><br> If MsgBox(&quot;Repair the Northwind database?&quot;, _<br> vbYesNo) = vbYes Then<br> On Error GoTo Err_Repair<br> DBEngine.RepairDatabase &quot;Northwind.mdb&quot;<br> On Error GoTo 0<br> MsgBox &quot;End of repair procedure!&quot;<br> End If<br><br> Exit Sub<br><br>Err_Repair:<br><br> For Each errLoop In DBEngine.Errors<br> MsgBox &quot;Repair unsuccessful!&quot; & vbCr & _<br> &quot;Error number: &quot; & errLoop.Number & _<br> vbCr & errLoop.Description<br><br>Next errLoop<br><br>End Sub<br><br><br><br><br>HTH<br><br>Paulf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top