下面是我写的备份程序,但总保存不成功! 请指点 ! 谢谢!!!
Private Sub m_Backup_Click()
Dim filename1, filename2 As String
On Error GoTo closeerror
cmdlDataBase.Filter = "ztcy_sfj.mdb"
cmdlDataBase.ShowOpen
filename1 = cmdlDataBase.FileName
cmdlDataBase.ShowSave '被备份的文件名
filename2 = cmdlDataBase.FileName
closeerror:
If Err.Number = 75 Or Err.Number = 53 Then
Exit Sub
Else
If Err.Number = 70 Then
If filename1 = filename2 Then
MsgBox "文件名已存在,是否覆盖! "
Exit Sub
Else
Exit Sub
End If
Else
FileCopy "ztcy_sfj.mdb", filename2
MsgBox "保存成功!", , "保存"
End If
End If
End Sub