📄 frmrestore.frm
字号:
VERSION 5.00
Object = "{BA513CF3-1BFD-4976-B2DA-2F1A208D11F9}#1.0#0"; "vkusercontrolsxp.ocx"
Begin VB.Form frmRestore
BorderStyle = 0 'None
ClientHeight = 3000
ClientLeft = 0
ClientTop = 0
ClientWidth = 4980
ControlBox = 0 'False
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 3000
ScaleWidth = 4980
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin vkUserContolsXP.vkCommand vkCommand2
Height = 375
Left = 2640
TabIndex = 5
Top = 2400
Width = 1575
_ExtentX = 2778
_ExtentY = 661
BackColorPushed1= 16514043
BackColorPushed2= 14474460
Caption = "取消"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "frmRestore.frx":0000
End
Begin VB.FileListBox File1
Height = 990
Left = 3600
Pattern = "*.mdb"
TabIndex = 4
Top = 1320
Visible = 0 'False
Width = 1215
End
Begin vkUserContolsXP.vkCommand vkCommand1
Height = 375
Left = 480
TabIndex = 1
Top = 2400
Width = 1575
_ExtentX = 2778
_ExtentY = 661
BackColorPushed1= 16514043
BackColorPushed2= 14474460
Caption = "还原"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "frmRestore.frx":039A
End
Begin vkUserContolsXP.vkFrame vkFrame1
Height = 3015
Left = 0
TabIndex = 0
Top = 0
Width = 5000
_ExtentX = 8811
_ExtentY = 5318
Caption = "数据还原"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Begin VB.ComboBox Combo1
Height = 345
Left = 1440
Style = 2 'Dropdown List
TabIndex = 3
Top = 360
Width = 2175
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "该操作将覆盖现有的数据库,请先备份数据库"
Height = 225
Left = 600
TabIndex = 6
Top = 1440
Width = 3600
End
Begin VB.Image Image1
Height = 240
Left = 240
Picture = "frmRestore.frx":0734
Top = 1440
Width = 240
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请选择还原点"
Height = 225
Left = 120
TabIndex = 2
Top = 360
Width = 1080
End
End
End
Attribute VB_Name = "frmRestore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
On Error GoTo ErrFlag
Dim i As Long
File1.Path = MyAppInfo.BackUpPath & "\"
For i = 1 To File1.ListCount
If Len(File1.List(i - 1)) > 16 Then
Combo1.AddItem Mid(File1.List(i - 1), 6, Len(File1.List(i - 1)) - 9)
End If
Next
If Combo1.ListCount > 0 Then Combo1.ListIndex = 0
Exit Sub
ErrFlag:
MsgBox "[读取备份数据库]" & Err.Description, vbOKOnly + vbCritical
End Sub
Private Sub vkCommand1_Click()
On Error GoTo ErrFlag
Dim strTempFile As String
If Combo1.Text = "" Then
MsgBox "没有找到还原点", vbOKOnly + vbExclamation
Exit Sub
End If
If MsgBox("确定要还原数据库吗, 请先备份数据库", vbYesNo + vbQuestion) = vbNo Then Exit Sub
strTempFile = GetTempDirectory & "temp.mdb"
CopyFile MyAppInfo.DataPath, strTempFile, 0
If CopyFile(MyAppInfo.BackUpPath & "\data-" & Combo1.Text & ".mdb", MyAppInfo.DataPath, 0) = 0 Then
MsgBox "还原失败", vbOKOnly + vbCritical
CopyFile strTempFile, MyAppInfo.DataPath, 0
Exit Sub
Else
MsgBox "还原成功", vbOKOnly + vbExclamation
End If
Kill strTempFile
Exit Sub
ErrFlag:
MsgBox "[还原数据库]" & Err.Description, vbOKOnly + vbCritical
End Sub
Private Sub vkCommand2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -