📄 frm_beifen.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Frm_beifen
BorderStyle = 1 'Fixed Single
Caption = "备份数据"
ClientHeight = 1470
ClientLeft = 4185
ClientTop = 3105
ClientWidth = 4170
Icon = "Frm_beifen.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1470
ScaleWidth = 4170
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command3
Caption = "打开"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3600
TabIndex = 4
Top = 120
Width = 495
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 2460
TabIndex = 3
Top = 840
Width = 1155
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 540
TabIndex = 2
Top = 840
Width = 1155
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 3540
Top = 480
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.TextBox Text1
Height = 315
Left = 1020
TabIndex = 1
Top = 180
Width = 2475
End
Begin VB.Label Label1
Caption = "备份路径"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 855
End
End
Attribute VB_Name = "Frm_beifen"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
' Set fso = CreateObject("Scripting.FileSystemObject")
' Set f2 = fso.GetFile("c:\testfile.txt")
' f2.Copy ("c:\temp\testfile.txt")
On Error GoTo myerr
FileCopy App.Path & "\data\wuye.mdb", Text1
MsgBox "备份成功!", vbExclamation, "提示"
Unload Me
Exit Sub
myerr:
MsgBox Error, vbExclamation, "提示"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
On Error GoTo myerr
Dim SaveFilePath As String
With CommonDialog1
.CancelError = True
.Filter = "Access文件(*.mdb)|*.mdb"
.DialogTitle = "备份Access"
.ShowSave
If Trim(.FileName) = "" Then
Exit Sub
End If
SaveFilePath = .FileName
End With
Text1 = SaveFilePath
myerr:
Select Case Err.Number
Case 0
Case 32755 '用户取消时的错误号
Exit Sub
Case Else
MsgBox Err.Description, vbExclamation, "提示"
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -