📄 frm_hy.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Frm_hy
Caption = "数据恢复"
ClientHeight = 4800
ClientLeft = 60
ClientTop = 345
ClientWidth = 6150
Icon = "Frm_hy.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4800
ScaleWidth = 6150
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame2
Caption = "请选择数据库文件"
Height = 3375
Left = 3120
TabIndex = 7
Top = 105
Width = 2955
Begin VB.FileListBox File1
Height = 1890
Left = 120
Pattern = "*.mdb"
TabIndex = 10
Top = 1320
Width = 2655
End
Begin VB.DirListBox Dir1
Height = 720
Left = 120
TabIndex = 9
Top = 600
Width = 2655
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 120
TabIndex = 8
Top = 240
Width = 2655
End
End
Begin VB.Frame Frame1
Caption = "备份卡列表"
Height = 3375
Left = 75
TabIndex = 5
Top = 105
Width = 2955
Begin MSComctlLib.ListView ListView1
Height = 3045
Left = 120
TabIndex = 6
Top = 240
Width = 2670
_ExtentX = 4710
_ExtentY = 5371
Sorted = -1 'True
LabelWrap = -1 'True
HideSelection = -1 'True
AllowReorder = -1 'True
_Version = 393217
Icons = "ImageList1"
SmallIcons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin MSComctlLib.ImageList ImageList1
Left = 1260
Top = 120
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_hy.frx":1C7A
Key = ""
EndProperty
EndProperty
End
End
Begin VB.CommandButton Command2
Caption = "返 回"
Height = 345
Left = 4770
TabIndex = 3
Top = 4380
Width = 1000
End
Begin VB.CommandButton Command1
Caption = "开始恢复"
Height = 345
Left = 3210
TabIndex = 2
Top = 4380
Width = 1000
End
Begin VB.OptionButton Option2
Caption = "数据恢复"
Height = 300
Left = 150
TabIndex = 0
Top = 5115
Width = 1140
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 255
Left = 15
TabIndex = 1
Top = 4005
Width = 6060
_ExtentX = 10689
_ExtentY = 450
_Version = 393216
Appearance = 1
End
Begin VB.Label Label1
ForeColor = &H00000000&
Height = 375
Left = 75
TabIndex = 4
Top = 3555
Width = 6015
End
End
Attribute VB_Name = "Frm_hy"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim itmX, key As String '定义字符串变量
Dim a As Integer '定义整型变量
Dim workarea(600) As String
Dim counter As Integer '定义一个整型变量
Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
Private Sub Form_Load()
Dir1_Change
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
'添加数据备份卡到列表中
ListView1.ListItems.Clear
If File1.ListCount <> 0 Then
a = 0
Do While File1.ListIndex < File1.ListCount - 1
File1.ListIndex = a
key = File1.FileName
Set itmX = ListView1.ListItems.Add(, , key, 1)
a = a + 1
Loop
End If
Label1.Caption = Dir1.Path & "\" & File1.FileName
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Label1.Caption = Dir1.Path & "\" & File1.FileName '获取路径
End Sub
Private Sub Command1_Click()
ProgressBar1.Visible = True
ProgressBar1.Max = UBound(workarea)
ProgressBar1.Value = ProgressBar1.Min
For counter = LBound(workarea) To UBound(workarea)
workarea(counter) = "initial value " & counter
ProgressBar1.Value = counter
If Option2.Value = True Then
'恢复指定路径下的数据库
If File1.ListCount <> 0 Then
CopyFile ListView1.SelectedItem, File1.FileName, False
Me.MousePointer = 0
Else
MsgBox "请选择要恢复的数据!", , "系统提示"
End If
End If
Next counter
ProgressBar1.Visible = False
ProgressBar1.Value = ProgressBar1.Min
If Option2.Value = True Then MsgBox "数据恢复成功!", , "系统提示"
End Sub
Private Sub Command2_Click()
Unload Me
Frm_main.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -