Private Sub cmdOk_Click()
    On Error GoTo Err_Hand
    
    If MsgBox("此操作将恢复 " & Cmbfile & " ！您确认吗（Y/N）？", vbYesNo + vbQuestion + vbDefaultButton2, "提示") = 7 Then Exit Sub
    
    cPMasterConn.Execute "RESTORE DATABASE 教学成绩管理数据库 FROM DISK = '" & "e:\" & Cmbfile & "'"
    
    Me.MousePointer = vbHourglass
    
    cPMasterConn.Close
    MsgBox "数据恢复完毕！", vbInformation, "提示"
    Unload Me
    Unload MainFrm
    Exit Sub
    
Err_Hand:
    If cPMasterConn.Errors.Count = 0 Then
        MsgBox "错 误 号：" & Err.Number & vbCrLf & _
               "错误描述：" & Err.Description & vbCrLf & _
               "错误来源：" & Err.Source & vbCrLf & _
               "请通知系统管理员...", vbExclamation, "提示"
        Me.MousePointer = vbDefault
        Exit Sub
    End If

    Select Case cPMasterConn.Errors(0).NativeError
        Case 3101
            MsgBox "数据库还有别人在使用，请关闭后重试...", vbExclamation, "提示"
            Me.MousePointer = vbDefault
            Exit Sub
        Case Else
            MsgBox "错 误 号：" & cPMasterConn.Errors(0).NativeError & vbCr & vbLf & _
                "错误信息：" & cPMasterConn.Errors(0).Description & vbCr & vbLf & _
                vbCr & vbLf & "请通知系统管理员！", vbExclamation, "提示"
            Me.MousePointer = vbDefault
            Exit Sub
    End Select
End Sub
