📄 frmbeifen.frm
字号:
VERSION 5.00
Begin VB.Form frmbeifen
BackColor = &H00000000&
Caption = "数据备份"
ClientHeight = 2685
ClientLeft = 60
ClientTop = 465
ClientWidth = 6600
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2685
ScaleWidth = 6600
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 495
Left = 4800
TabIndex = 5
Top = 1320
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "开始备份"
Height = 495
Left = 4800
TabIndex = 4
Top = 480
Width = 1455
End
Begin VB.TextBox txtPath
Height = 300
Left = 840
TabIndex = 3
Top = 2160
Width = 3495
End
Begin VB.DirListBox Dir1
Height = 1350
Left = 840
TabIndex = 2
Top = 600
Width = 3495
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 840
TabIndex = 1
Top = 120
Width = 3495
End
Begin VB.Label Label3
BackColor = &H00000000&
Caption = "文件夹:"
ForeColor = &H00FFFFFF&
Height = 255
Left = 120
TabIndex = 7
Top = 600
Width = 735
End
Begin VB.Label Label2
BackColor = &H00000000&
Caption = "磁盘:"
ForeColor = &H00FFFFFF&
Height = 255
Left = 120
TabIndex = 6
Top = 165
Width = 615
End
Begin VB.Label Label1
BackColor = &H00000000&
Caption = "备份到:"
ForeColor = &H00FFFFFF&
Height = 255
Left = 120
TabIndex = 0
Top = 2205
Width = 855
End
End
Attribute VB_Name = "frmbeifen"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'开始备份
Private Sub Command1_Click()
YesNo = MsgBox("确定进行数据库备份?", vbQuestion)
If YesNo = vbNo Then
Exit Sub
End If
On Error GoTo errprompt
Me.MousePointer = 11
'FileCopy App.Path & "\db.mdb", "txtPath.Text" & "\db" & Date & ".mdb" '有问题
'FileCopy App.Path & "\db.mdb", "d:\db" & Date & ".mdb"
FileCopy App.Path & "\db.mdb", Trim(txtPath.Text) & "\db" & Date & ".mdb"
Me.MousePointer = 0
MsgBox "数据已备份完毕。"
errprompt:
Me.MousePointer = 0
Select Case Err.Number
Case 57
MsgBox "磁盘已坏!", vbCritical
Case 70
MsgBox "磁盘写保护!", vbCritical
Case 71
MsgBox "磁盘未准备好!", vbCritical
End Select
End Sub
'取消
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Dir1_Change()
txtPath.Text = Dir1
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1
End Sub
Private Sub Form_Load()
txtPath.Text = App.Path
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -