📄 frmbeifen.frm
字号:
VERSION 5.00
Begin VB.Form frmbeifen
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
ClientHeight = 4995
ClientLeft = 45
ClientTop = 330
ClientWidth = 8625
Icon = "frmbeifen.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
MouseIcon = "frmbeifen.frx":0442
ScaleHeight = 4995
ScaleWidth = 8625
StartUpPosition = 2 '屏幕中心
Begin VB.Frame frmbeifen
BackColor = &H00C0C0C0&
Caption = "数据备份"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 4455
Left = 360
TabIndex = 0
Top = 120
Width = 7695
Begin VB.CommandButton Command1
Appearance = 0 'Flat
Caption = "备份"
BeginProperty Font
Name = "黑体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 4800
TabIndex = 5
Top = 720
Width = 1455
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 720
TabIndex = 4
Top = 960
Width = 3375
End
Begin VB.DirListBox Dir1
Height = 2190
Left = 720
TabIndex = 3
Top = 1560
Width = 3375
End
Begin VB.TextBox Text1
Height = 390
Left = 720
TabIndex = 2
Top = 360
Width = 3375
End
Begin VB.CommandButton Command2
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
Caption = "返回"
BeginProperty Font
Name = "黑体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 4800
TabIndex = 1
Top = 2760
Width = 1455
End
End
End
Attribute VB_Name = "frmbeifen"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim b As String
Private Sub Command1_Click()
Dim a As String
a = App.Path
a = a & "\"
b = Text1.Text
'On Error GoTo errhandle:
Dim filename As String
filename = "" & Text1.Text & "dbdb.mdb"
If a = Text1.Text Then
MsgBox "备份目录与原文件目录相同,请重新选择!"
Exit Sub
End If
If Dir("" & b & "dbdb.mdb") <> "" Then
Dim llp As String
llp = MsgBox("此目录下已有该文件,要覆盖吗?", vbYesNo, "备份文件")
If llp = vbYes Then
Kill ("" & b & "dbdb.mdb")
FileCopy "" & a & "\data\dbdb.mdb", "" & b & "dbdb.mdb"
Dim l
l = MsgBox(" 备份成功! ", vbOKOnly, "提示")
Else
Exit Sub
End If
Else
FileCopy "" & a & "\data\dbdb.mdb", "" & b & "dbdb.mdb"
Dim ll
ll = MsgBox(" 备份成功! ", vbOKOnly, "提示")
End If
Exit Sub
'errhandle:
'MsgBox "出现错误,不能复制", vbOKOnly + vbCritical, "复制文件"
'Resume Next
End Sub
Private Sub Command2_Click()
'dy
'Me.Hide
Unload Me
End Sub
Private Sub Dir1_Change()
'Drive1.Drive = Dir1
If Right(Dir1.Path, 1) <> "\" Then
Text1.Text = Dir1.Path + "\"
Else
Text1.Text = Dir1.Path
End If
Command1.Enabled = True
End Sub
Private Sub Dir1_Click()
If Right(Dir1.Path, 1) <> "\" Then
Text1.Text = Dir1.Path + "\"
Else
Text1.Text = Dir1.Path
End If
Command1.Enabled = True
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Activate()
Command1.Enabled = False
gCnn.Close
ChDrive App.Path
ChDir App.Path
'Text1.SetFocus
'Text1.Text = "c:\"
Text1.Text = CurDir()
Text1.Enabled = False
End Sub
Private Sub Form_Load()
ChDrive App.Path
ChDir App.Path
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
dy
End Sub
Private Sub Form_Unload(Cancel As Integer)
If gCnn.State = 0 Then
gCnn.ConnectionString = cnn
gCnn.CursorLocation = adUseClient
gCnn.Open
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -