home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / browse_1 / repair.frm < prev    next >
Text File  |  1993-07-19  |  982b  |  41 lines

  1. VERSION 2.00
  2. Begin Form frmRepair 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Click form to reapair / compact DEMO.MDB"
  5.    ClientHeight    =   336
  6.    ClientLeft      =   876
  7.    ClientTop       =   1296
  8.    ClientWidth     =   5292
  9.    Height          =   672
  10.    Left            =   828
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   336
  15.    ScaleWidth      =   5292
  16.    Top             =   1008
  17.    Width           =   5388
  18. End
  19. Option Explicit
  20.  
  21. Sub Form_Click ()
  22.    Dim nF As Integer, cD As String, cDB As String
  23.  
  24.    cD = App.Path + "\" + "DEMO.MDB"
  25.    cDB = App.Path + "\" + "DEMO_BAK.MDB"
  26.    On Error GoTo Abort_Repair
  27.    RepairDatabase cD
  28.    Name cD As cDB
  29.    CompactDatabase cDB, cD
  30.    Kill cDB
  31.    MsgBox "DONE!"
  32.    GoTo sub_exit
  33.  
  34. Abort_Repair:
  35.    MsgBox "Could not repair file, error: " & Error
  36.    Resume sub_exit
  37. sub_exit:
  38.    Unload Me
  39. End Sub
  40.  
  41.