📄 mdbsave.frm
字号:
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form Form5
BorderStyle = 3 'Fixed Dialog
Caption = "数据备份"
ClientHeight = 3465
ClientLeft = 45
ClientTop = 330
ClientWidth = 5205
LinkTopic = "Form5"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3465
ScaleWidth = 5205
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Caption = "请选择盘符和路径"
Height = 3255
Left = 120
TabIndex = 0
Top = 120
Width = 4935
Begin VB.CommandButton Command2
Caption = "关闭"
Height = 375
Left = 3600
TabIndex = 4
Top = 960
Width = 1095
End
Begin VB.CommandButton Command1
BackColor = &H8000000A&
Caption = "开始备份"
Height = 375
Left = 3600
MaskColor = &H00E0E0E0&
TabIndex = 3
Top = 360
Width = 1095
End
Begin VB.DirListBox Dir1
Height = 1770
Left = 240
TabIndex = 2
Top = 840
Width = 3135
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 240
TabIndex = 1
Top = 360
Width = 3135
End
Begin ComctlLib.ProgressBar prog
Height = 255
Left = 240
TabIndex = 5
Top = 2760
Width = 4455
_ExtentX = 7858
_ExtentY = 450
_Version = 327682
Appearance = 1
End
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim i As Integer
Unload Form1
On Error GoTo aa
If Right(Dir1.Path, 1) <> "\" Then
FileCopy App.Path + "\odb.dll", Form5.Dir1.Path & "\odb" & Month(Now) & Day(Now) & ".mdb"
Else
FileCopy App.Path + "\odb.dll", Form5.Dir1.Path & "odb" & Month(Now) & Day(Now) & ".mdb"
End If
prog.Visible = True
For i = 0 To 100
prog.Value = i
Next i
MsgBox "备份完毕!", 0 + 64
prog.Visible = False
Unload Me
MainFrm.Show
Exit Sub
aa:
Select Case Err.Number
Case 53
MsgBox "数据库丢失,请立即恢复"
Case 3026
MsgBox "磁盘无足够空间"
Case 68
MsgBox "设备未准备好"
Case 61
MsgBox "磁盘空间满"
Case Is > 0
MsgBox "写保护关闭,或其他错误"
End Select
Form1.Show
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
MsgBox Dir1.Path
End Sub
Private Sub Drive1_Change()
On Error GoTo aaa
Dir1.Path = Drive1.Drive
Exit Sub
aaa:
msg = MsgBox("没有磁盘", vbRetryCancel + 48)
If msg = vbRetry Then
Resume 0
Else
Drive1.Drive = "c:"
End If
End Sub
Private Sub Form_Activate()
prog.Visible = False
prog.Value = 0
End Sub
Private Sub ProgressBar1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -