Performing a Compact&Repair on both FE and BE (1 Viewer)

msowards

Registered User.
Local time
Today, 04:59
Joined
Feb 16, 2012
Messages
21
I'm sure I'm just being blind here. I need to compact my BE data file, but the code fails because the initial file copy to backup the data file gives a permission denied. (The file is still in use). How does the front end release it's hold?
I've seen several examples of compacting the MS Access Backend, but they all predicate their code with the statament 'Make sure all connections to the BE are disconnected".
In my case both files are local. There are no other users. All forms in the FE have been closed.
The user is not a DBadmin type so a single button on the front end app to compact both would be ideal. Here is the compact code...

Code:
Public Function BE_Compact(Cnnt_str As String, frm_nm As String) As Boolean
On Error GoTo Err_BE_Compact
    
        Dim Fl_BE_Cnt_Str As String, BE_DB_Name_Str As String, s_Pos As Integer, BE_Path_Str As String, BE_Full_Nm_Str As String
        Dim Tmp_BE_Hold_FNM_Str As String, BkUp_FNMN_Str As String, Err_Pos As Integer, T_Def As TableDef
        Dim New_Db As Database, e_Cnt As Integer
        Dim ErrAns As Integer, ErrMsg As String

Err_Pos = 1
'close calling form
        If IsFormLoaded(frm_nm) Then
            DoCmd.Close acForm, frm_nm
        End If
    
        
        Fl_BE_Cnt_Str = Cnnt_str
        BE_Full_Nm_Str = Split(Split(Fl_BE_Cnt_Str, "Database=")(1), ";")(0)
        s_Pos = InStrRev(Fl_BE_Cnt_Str, "\")
        BE_DB_Name_Str = Right(Fl_BE_Cnt_Str, Len(Fl_BE_Cnt_Str) - s_Pos)
        s_Pos = InStrRev(BE_Full_Nm_Str, "\")
        BE_Path_Str = Left(BE_Full_Nm_Str, s_Pos)
        Tmp_BE_Hold_FNM_Str = BE_Path_Str & "Tmp_BE.accdb"



Err_Pos = 5
        
       're-map current table links to empty DB with same table Structure
        For Each T_Def In CurrentDb.TableDefs
            If InStr(T_Def.Name, "MSys") = 0 Then
                T_Def.Connect = ";Database=" & BE_Path_Str & "MPD_BEStruct.accdb"
                T_Def.RefreshLink
            End If
            
            
        Next T_Def
        
Err_Pos = 10
        'Backup
        s_Pos = InStrRev(BE_DB_Name_Str, ".")
        BkUp_FNMN_Str = Left(BE_DB_Name_Str, s_Pos) & ".BAK"
Err_Pos = 15
        ' remove  possible left over backup
        Kill BE_Path_Str & BkUp_FNMN_Str
        On Error GoTo Err_BE_Compact
Err_Pos = 20
        
        FileCopy BE_Full_Nm_Str, BE_Path_Str & BkUp_FNMN_Str
        'Compact
        DBEngine.CompactDatabase BE_Full_Nm_Str, Tmp_BE_Hold_FNM_Str
Err_Pos = 25
        'Delete Uncompacted Version
        Kill BE_Full_Nm_Str
Err_Pos = 30
        
        'Rename Compacted Version
        Name Tmp_BE_Hold_FNM_Str As BE_Full_Nm_Str
               
Err_Pos = 35
   'reconnect to the new compacted Back End
        For Each T_Def In CurrentDb.TableDefs
            If InStr(T_Def.Name, "MSys") = 0 Then
                T_Def.Connect = ";Database=" & BE_Path_Str & BE_DB_Name_Str
                T_Def.RefreshLink
            End If
        Next T_Def
        
        ' let backup stay around if compact has corrupted DB
        'Kill BE_Path_Str & "MPD_BEStruct.accdb"
        
Err_Pos = 40
                
        SendKeys "%(FMC)"
                    

'
  
Exit_BE_Compact:
    Exit Function

Err_BE_Compact:
    e_Cnt = e_Cnt + 1
    If e_Cnt < 1000 Then
        Select Case Err.Number
            Case 3204
                If Err_Pos = 5 Then
                    Kill BE_Path_Str & "MPD_BEStruct.accdb"
                End If
                Resume
            Case Else
                Dim Why_Str As String
                Select Case Err_Pos
                    Case 5
                        Why_Str = "record Source Disconnect Error"
                    Case 10
                        Why_Str = "record Source Disconnect Error"
                    Case 15
                        Why_Str = "Previous Backup won't delete"
                    Case 20
                        Why_Str = "Tmp Back up of BackEnd datafile failed"
                    Case 25
                        Why_Str = "Compac of BackEnd failed"
                    Case 30
                        Why_Str = "Rename of compacted BackEnd failed"
                    Case 35
                        Why_Str = "Reconnect to BackEnd failed"
                End Select
                If ErrChoice = vbYesNoCancel Then
                    ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & Why_Str & vbNewLine & "Press 'Yes' to resume next;" & vbCrLf & _
                        "'No' to Exit Procedure." & vbCrLf & "or 'Cancel' to break into code"
                Else
                    ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & Why_Str & vbNewLine & "Press 'Yes' to resume next;" & vbCrLf & _
                        "'No' to Exit Procedure."
                End If
       End Select
    Else
        Why_Str = "Too Many Errors"
        ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & Why_Str & vbNewLine & _
            "Press 'OK' to Exit Procedure."
        ErrAns = MsgBox(ErrMsg, _
            vbCritical + vbQuestion + vbOKOnly, "Function: BE_Compact")
        Resume Exit_BE_Compact

   End If
   
    ErrAns = MsgBox(ErrMsg, _
        vbCritical + vbQuestion + ErrChoice, "Function: BE_Compact")
    If ErrAns = vbYes Then
        Resume Next
    ElseIf ErrAns = vbCancel Then
        On Error GoTo 0
        Resume
    Else
        Resume Exit_BE_Compact
    End If

End Function
At error postion 20 the file copy fails...

How do I release the FE's hold on the Backend? What is odd is I can manually copy the file while the FE is attached by using Explorer so I can understand why I can't copy the file in VBA.
 

boblarson

Smeghead
Local time
Today, 04:59
Joined
Jan 12, 2001
Messages
32,059
How do I release the FE's hold on the Backend? What is odd is I can manually copy the file while the FE is attached by using Explorer so I can understand why I can't copy the file in VBA.
When you do a Compact and Repair, what is happening behind the scenes is that the database file is copied (but not in the normal way) and then the old datbase file is deleted and the new one renamed. So, if it is open, it can't do the process.

What you will need to so is probably use a method I used for my Frontend Auto Update Enabling Tool which has code to create a batch file, kick off the batch file, close itself, let the batch file delete the old file and then reopen the new one. But in your case the parts you would use are the creation of the batch file and then kicking it off and closing your database. You should have another Access database with the code to do the compact and repair and that can be kicked off by the batch file, it do its thing and then it closes itself.

Here is the code for compacting which you could put into a standard module in the third database, and then create an AutoExec macro which calls this function.
Code:
Public Function CompactDb()
Dim strDbNameOld As String
Dim strDBNameNew As String

strDbNameOld = "YourPathAndNameToTheFileYouWantToCompact"

        DBEngine.CompactDatabase strDBNameOld, strDBNameNew
        Kill strDBNameOld
        Name strDBNameNew As strDBNameOld
End Function

And the code to create the batch file, start it, and quit the database.
Code:
Public Sub CreateBatchFile(strDBToStartFileAndPath As String)
Dim strCmdBatch As String
Dim strDb As String
Dim strCmd As String
' sets the file name of the batch file to create
strCmd = CurrentProject.Path & "\StartDb.cmd"
' sets the file name
strDBToStartFileAndPath = """" & strDBToStartFileAndPath & """"
' creates the batch file
If Dir(strCmd) <> vbNullString Then
   Kill strCmd
End If
Open strCmd For Output As #1

Print #1, "Echo Off"
Print #1, "ping 1.1.1.1 -n 1 -w 2000"
Print #1, "START /I " & """MSAccess.exe"" " & strDBToStartFileAndPath
Close #1


' runs the batch file
Shell strCmd
 
'closes the current database and runs the batch file
DoCmd.Quit
 
End Sub
 

msowards

Registered User.
Local time
Today, 04:59
Joined
Feb 16, 2012
Messages
21
Thank you Bob.
That was the kick in the pants I needed. So I abandoned my futile effor
to get the FE to release the BE. I switched to your idea of an external agent, but with out submitting a batch file. I created a third "Compressor" accde which has a single table and a startup form. The startup form will compress both the FE and BE. The Compressor.accde is initiated by a button on the Admin form of the front end which also quit the FE app close both the FE and BE. The following is the code to compact and launch the Compressor from the FE.
:D
Code:
Private Sub Cmp_N_Rpr_CMD_Click()
On Error GoTo Err_Cmp_N_Rpr_CMD_Click

'
    If MsgBox("This will compact and repair the database." & vbCrLf & _
                "It may close and then reopen database to complete the task." & vbCrLf & _
                "Do you want to continue?", vbQuestion + vbYesNo, App_Q_MsgBx_Ttl) = vbYes Then
                'update last cmpct date
        Dim flg As Boolean
        Me.Last_Compact_Date = Now()
        Me.ReDacted_Rec_Count = 0
        Dim Fl_BE_Cnt_Str As String, BE_Full_Nm_Str As String, BE_Path_Str  As String, FE_Full_Nm_Str As String
        Dim Cmp_Db As Database, e_Cnt As Integer, UpDt_Qry_Str As String, RetVal As Long
        Dim ErrAns As Integer, ErrMsg As String, Why_Str As String, Err_Pos As Integer, Compressor_Name_Str As String

Err_Pos = 1
        e_Cnt = 0
        Fl_BE_Cnt_Str = CurrentDb.TableDefs("MPD_Defaults_TBL").Connect
        BE_Full_Nm_Str = Split(Split(Fl_BE_Cnt_Str, "Database=")(1), ";")(0)
        BE_Path_Str = Left(BE_Full_Nm_Str, InStrRev(BE_Full_Nm_Str, "\"))
        FE_Full_Nm_Str = CurrentProject.FullName
        ' chang in this one spot to switch between tesing the accdb to operational accde
        Compressor_Name_Str = "Compressor.accde"
        'first open compressor DB and input names of both frontend and backend files
Err_Pos = 5
        DoCmd.Hourglass True
        Set Cmp_Db = OpenDatabase(BE_Path_Str & Compressor_Name_Str, , False)
        UpDt_Qry_Str = "Update MPD_Defaults_TBL set FE_Full_Name = '" & FE_Full_Nm_Str & "', BE_Full_Name = '" & BE_Full_Nm_Str & "'"
        DoCmd.SetWarnings False
        Cmp_Db.Execute UpDt_Qry_Str
        DoCmd.SetWarnings True
        Cmp_Db.Close
        Set Cmp_Db = Nothing
        'then let's compress the compressor 
Err_Pos = 7
        If Check_file(BE_Path_Str & "Compressor.hold") Then
            Kill BE_Path_Str & "MPD_BECompressor.hold"
        End If
Err_Pos = 8
        FileCopy BE_Path_Str & Compressor_Name_Str, BE_Path_Str & "MPD_BECompressor.BAK"
        
        If Check_file(BE_Path_Str & "Compressor.BAK") Then
Err_Pos = 10
            DBEngine.CompactDatabase BE_Path_Str & Compressor_Name_Str, BE_Path_Str & "Compressor.hold"
        End If
        
        If Check_file(BE_Path_Str & "Compressor.hold") Then
Err_Pos = 13
            Kill BE_Path_Str & Compressor_Name_Str
Err_Pos = 15
            Name BE_Path_Str & "Compressor.hold" As BE_Path_Str & Compressor_Name_Str
        End If
Err_Pos = 20
        
        
Err_Pos = 30
        RetVal = ShellExecute(0, "open", BE_Path_Str & Compressor_Name_Str, "", BE_Path_Str, 1)
        
        Kill BE_Path_Str & "Compressor.BAK"
        
        DoCmd.Quit acQuitPrompt
        
    
    End If

'
  
Exit_Cmp_N_Rpr_CMD_Click:

    DoCmd.SetWarnings True
    DoCmd.Hourglass False
    
    Exit Sub

Err_Cmp_N_Rpr_CMD_Click:
    e_Cnt = e_Cnt + 1
    If e_Cnt > 120 Or Err_Pos < 7 Then
        If ErrChoice = vbYesNoCancel Then
            ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & "Error limit exceeded" & vbCrLf & "Press 'Yes' to resume next;" & vbCrLf & _
                "'No' to Exit Procedure." & vbCrLf & "or 'Cancel' to break into code"
        Else
            ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & "Error limit exceeded" & vbCrLf & "Press 'Yes' to resume next;" & vbCrLf & _
                "'No' to Exit Procedure."
        End If
    Else
        Select Case Err.Number
            Case 53
                Select Case Err_Pos
                    Case 7, 13
                        Why_Str = "Missing file"
                        Resume Next
                End Select
                Why_Str = "Missing file"
            Case 52  ' bad file number
                Pause_Ops (1000)
                Why_Str = "Cannot acces file"
                Resume
            Case 70  ' permission denied
                Pause_Ops (1000)
                Why_Str = "Cannot acces file"
                Resume
            Case Else
                If ErrChoice = vbYesNoCancel Then
                    ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & "Press 'Yes' to resume next;" & vbCrLf & _
                        "'No' to Exit Procedure." & vbCrLf & "or 'Cancel' to break into code"
                Else
                    ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & "Press 'Yes' to resume next;" & vbCrLf & _
                        "'No' to Exit Procedure."
                End If
        End Select
    End If
    ErrAns = MsgBox(ErrMsg, _
        vbCritical + vbQuestion + ErrChoice, Me.Name & ": Cmp_N_Rpr_CMD_Click")
    If ErrAns = vbYes Then
        Resume Next
    ElseIf ErrAns = vbCancel Then
        On Error GoTo 0
        Resume
    Else
        Resume Exit_Cmp_N_Rpr_CMD_Click
    End If
End Sub

As you can see this launches the compressor using the shellexecute command and then quits the FE.

Following is the code on the start up form in the compressor.accde
Code:
Private Sub Form_Load()
On Error GoTo Err_Form_Load
Dim Lim As Integer, Pos1 As Integer
Dim UpDt_Qry_Str As String

' 
        DoCmd.Minimize
        Call Compact_DB

Exit_Form_Load:
    Exit Sub

Err_Form_Load:
    Select Case Err.Number
        Case Else
            Dim ErrAns As Integer, ErrMsg As String
            If ErrChoice = vbYesNoCancel Then
                ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & "Press 'Yes' to resume next;" & vbCrLf & _
                    "'No' to Exit Procedure." & vbCrLf & "or 'Cancel' to break into code"
            Else
                ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & "Press 'Yes' to resume next;" & vbCrLf & _
                    "'No' to Exit Procedure."
            End If
            ErrAns = MsgBox(ErrMsg, _
                vbCritical + vbQuestion + ErrChoice, Me.Name & ": Form_Load")
            If ErrAns = vbYes Then
                Resume Next
            ElseIf ErrAns = vbCancel Then
                On Error GoTo 0
                Resume
            Else
                Resume Exit_Form_Load
            End If
    End Select
End Sub

Private Sub Compact_DB()
On Error GoTo Err_Compact_DB
        Dim Fl_BE_Cnt_Str As String, BE_DB_Name_Str As String, s_Pos As Integer, BE_Path_Str As String, BE_Full_Nm_Str As String
        Dim Tmp_Hold_FNM_Str As String, BkUp_FNMN_Str As String, Err_Pos As Integer, T_Def As TableDef
        Dim New_Db As Database, e_Cnt As Integer, FE_Path_Str As String, FE_DB_Name_Str As String
        Dim ErrAns As Integer, ErrMsg As String, Why_Str As String, RetrnVal As Long, UpDt_Qry_Str As String
        Dim Db As Database
        ' display message: will probably be no more than a flash usually
        DoCmd.OpenForm "Compaction Notification", acNormal
        
'instead of having controls on the form tied to the table I use SQL to 
' pull the infor into a undound combo box    get the name of the FE and BE
        If Not IsNull(Me.BE_FNm_CMB.Column(0, 0)) And Not IsNull(Me.FE_FNm_CMB.Column(0, 0)) Then
            If Len(Me.FE_FNm_CMB.Column(0, 0)) > 0 And Len(Me.BE_FNm_CMB.Column(0, 0)) > 0 Then
                'continue
                BE_Full_Name = Me.BE_FNm_CMB.Column(0, 0)
                FE_Full_Name = Me.FE_FNm_CMB.Column(0, 0)
                DoCmd.Hourglass True
                s_Pos = InStrRev(Fl_BE_Cnt_Str, "\")
                BE_DB_Name_Str = Right(BE_Full_Name, Len(BE_Full_Name) - s_Pos)
                s_Pos = InStrRev(BE_Full_Name, "\")
                BE_Path_Str = Left(BE_Full_Name, s_Pos)
                Tmp_Hold_FNM_Str = BE_Path_Str & "Tmp_BE.accdb"
                DoEvents
        Err_Pos = 10
                'Backup
                s_Pos = InStrRev(BE_DB_Name_Str, ".")
                BkUp_FNMN_Str = Left(BE_DB_Name_Str, s_Pos) & ".BAK"
        Err_Pos = 15
                ' remove  possible left over backup
                Kill BkUp_FNMN_Str
                DoEvents
        Err_Pos = 20
                
                FileCopy BE_Full_Name, BkUp_FNMN_Str
                'Compact
                DoEvents
        Err_Pos = 25
                If Check_file(BkUp_FNMN_Str) Then
                    DBEngine.CompactDatabase BE_Full_Name, Tmp_Hold_FNM_Str
                Else
                    'backup failed ask to proceed
                    If MsgBox("Back End Backup Failed." & vbNewLine & " Proceed with Compact?", vbYesNo + vbQuestion, App_Q_MsgBx_Ttl) = vbYes Then
                        DBEngine.CompactDatabase BE_Full_Nm_Str, Tmp_Hold_FNM_Str
                    Else
                        Exit Sub
                    End If
                End If
                'Delete Uncompacted Version
                DoEvents
                
                If Check_file(Tmp_Hold_FNM_Str) Then
                    Kill BE_Full_Name
        Err_Pos = 30
                    'Rename Compacted Version
                    Name Tmp_Hold_FNM_Str As BE_Full_Name
                Else
                    MsgBox "BE Compact Failed.", vbExclamation + vbOKOnly, App_N_MsgBx_Ttl
                    Exit Sub
                End If
                DoEvents
                       
                
                ' Nw let's do the Front end
                
                        
                        
                s_Pos = InStrRev(FE_Full_Name, "\")
                FE_DB_Name_Str = Right(FE_Full_Name, Len(FE_Full_Name) - s_Pos)
                s_Pos = InStrRev(FE_Full_Name, "\")
                FE_Path_Str = Left(FE_Full_Name, s_Pos)
                Tmp_Hold_FNM_Str = FE_Path_Str & "Tmp_FE.accde"
        
                  
        Err_Pos = 50
                'Backup
                s_Pos = InStrRev(FE_DB_Name_Str, ".")
                BkUp_FNMN_Str = Left(FE_DB_Name_Str, s_Pos) & ".BAK"
        Err_Pos = 55
                ' remove  possible left over backup
                Kill BkUp_FNMN_Str
                DoEvents
        
        Err_Pos = 60
                
                FileCopy FE_Full_Name, BkUp_FNMN_Str
                'Compact
        Err_Pos = 65
                DoEvents
                If Check_file(BkUp_FNMN_Str) Then
                    DBEngine.CompactDatabase FE_Full_Name, Tmp_Hold_FNM_Str
                Else
                    'backup failed ask to proceed
                    If MsgBox("Front End Backup Failed." & vbNewLine & " Proceed with Compact?", vbYesNo + vbQuestion, App_Q_MsgBx_Ttl) = vbYes Then
                        DBEngine.CompactDatabase BE_Full_Nm_Str, Tmp_Hold_FNM_Str
                    Else
                        Exit Sub
                    End If
                End If
                'Delete Uncompacted Version
                DoEvents
                
                If Check_file(Tmp_Hold_FNM_Str) Then
                    Kill FE_Full_Name
        Err_Pos = 70
                    'Rename Compacted Version
                    Name Tmp_Hold_FNM_Str As FE_Full_Name
                Else
                    MsgBox "FE Compact Failed.", vbExclamation + vbOKOnly, App_N_MsgBx_Ttl
                    Exit Sub
                End If
                'the compressing is complete let's prepare to restart the FE
                DoEvents
                Set Db = OpenDatabase(BE_Full_Name, , False)
                UpDt_Qry_Str = "Update MPD_Defaults_TBL set Compact_Just_Completed = true"
                DoCmd.SetWarnings False
                Db.Execute UpDt_Qry_Str
                DoCmd.SetWarnings True
                Db.Close
                Set Db = Nothing
                
                ' empty out location fields so that the compression does not run without being called from FE
                UpDt_Qry_Str = "Update MPD_Defaults_TBL set FE_Full_Name = '', BE_Full_name = ''"
                DoCmd.SetWarnings False
                DoCmd.RunSQL UpDt_Qry_Str
                DoCmd.SetWarnings True
                
                'so we've made it to the end let's restart
                RetrnVal = ShellExecute(0, "open", FE_Full_Name, "", FE_Path_Str, 1)
                DoCmd.Hourglass False
                
                DoCmd.Quit acQuitPrompt
            Else
                MsgBox "Compact Failed. Lost FE and BE Locations", vbExclamation + vbOKOnly, App_N_MsgBx_Ttl
         End If
    Else
        MsgBox "Compact Failed. FE and BE Locations", vbExclamation + vbOKOnly, App_N_MsgBx_Ttl
    End If
'
  
Exit_Compact_DB:
    DoCmd.Hourglass False
    DoCmd.SetWarnings True
    DoCmd.Quit acQuitPrompt
    Exit Sub

Err_Compact_DB:
    e_Cnt = e_Cnt + 1
    If e_Cnt < 5000 Then
        Select Case Err.Number
            Case 53
                Select Case Err_Pos
                    Case 15, 30, 55, 70
                        Why_Str = "Missing file"
                        Resume Next
                End Select
                Why_Str = "Missing file"
            Case 52  ' permission denied
                Select Case Err_Pos
                    Case 20, 60
                        Pause_Ops (1000)
                        Why_Str = "Cannot acces file"
                        Resume
                End Select
                Why_Str = "Cannot acces file"
          Case 70  ' permission denied
                Select Case Err_Pos
                    Case 20, 60
                        Pause_Ops (1000)
                        Why_Str = "Cannot acces file"
                        Resume
                End Select
                Why_Str = "Cannot acces file"
            Case 3204
                If Err_Pos = 5 Then
                    Kill BE_Path_Str & "MPD_BEStruct.accdb"
                End If
                Resume
            Case Else
                Select Case Err_Pos
                    Case 10, 50
                        Why_Str = "String manipulation Error"
                    Case 15, 55
                        Why_Str = "Previous Backup won't delete"
                    Case 20, 60
                        Why_Str = "Tmp Back up of BackEnd datafile failed"
                    Case 25, 65
                        Why_Str = "Compac of BackEnd failed"
                    Case 30, 70
                        Why_Str = "Rename of compacted BackEnd failed"
                End Select
       End Select
        If ErrChoice = vbYesNoCancel Then
            ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & Why_Str & vbNewLine & "Press 'Yes' to resume next;" & vbCrLf & _
                "'No' to Exit Procedure." & vbCrLf & "or 'Cancel' to break into code"
        Else
            ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & Why_Str & vbNewLine & "Press 'Yes' to resume next;" & vbCrLf & _
                "'No' to Exit Procedure."
        End If
    Else
        Why_Str = "Too Many Errors"
        ErrMsg = Err.Description & ": " & Str(Err.Number) & vbNewLine & Why_Str & vbNewLine & _
            "Press 'OK' to Exit Procedure."
        ErrAns = MsgBox(ErrMsg, _
            vbCritical + vbQuestion + vbOKOnly, "Function: BE_Compact")
        Resume Exit_Compact_DB

   End If
   
    ErrAns = MsgBox(ErrMsg, _
        vbCritical + vbQuestion + ErrChoice, "Function: BE_Compact")
    If ErrAns = vbYes Then
        Resume Next
    ElseIf ErrAns = vbCancel Then
        On Error GoTo 0
        Resume
    Else
        Resume Exit_Compact_DB
    End If

End Sub
 

speakers_86

Registered User.
Local time
Today, 07:59
Joined
May 17, 2007
Messages
1,919
In regards to your backend not being available, do you have any objects open in the fe that use the be as a datasource? I believe that will keep the be in use.
 

Users who are viewing this thread

Top Bottom