📄 frmrecover.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frmRecover
BorderStyle = 3 'Fixed Dialog
Caption = "数据库恢复"
ClientHeight = 3375
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 5490
ControlBox = 0 'False
Icon = "frmRecover.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3375
ScaleWidth = 5490
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin TabDlg.SSTab SSTab1
Height = 2475
Left = 150
TabIndex = 2
Top = 135
Width = 5175
_ExtentX = 9128
_ExtentY = 4366
_Version = 393216
Style = 1
Tabs = 1
TabHeight = 520
TabCaption(0) = "源文件"
TabPicture(0) = "frmRecover.frx":000C
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "Label2"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "Check1"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "Text1"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "Command1"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).ControlCount= 4
Begin VB.CommandButton Command1
Caption = "浏览(&B)..."
Height = 375
Left = 3180
TabIndex = 5
Top = 1275
Width = 1290
End
Begin VB.TextBox Text1
ForeColor = &H00FF0000&
Height = 270
Left = 1215
TabIndex = 4
Text = "A:\person.mdb"
Top = 675
Width = 3795
End
Begin VB.CheckBox Check1
Caption = "默认源文件"
Height = 255
Left = 690
TabIndex = 3
Top = 1335
Width = 2340
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "输入源文件:"
Height = 180
Left = 150
TabIndex = 6
Top = 720
Width = 1080
End
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 1215
Top = 2835
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton CancelButton
Cancel = -1 'True
Caption = "取消(&C)"
Height = 375
Left = 4020
TabIndex = 1
Top = 2895
Width = 1305
End
Begin VB.CommandButton OKButton
Caption = "确定(&O)"
Default = -1 'True
Height = 375
Left = 2580
TabIndex = 0
Top = 2895
Width = 1305
End
End
Attribute VB_Name = "frmRecover"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mFileName As String '路径数组
Private Sub CancelButton_Click()
mFileName = ""
Unload Me
End Sub
Private Sub Check1_Click()
On Error Resume Next
Dim ret As VbMsgBoxResult
Dim fs As Scripting.FileSystemObject
If Check1.Value = 1 Then
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists(BK_PATH & DATABASE_FILENAME) Then
Text1.Text = BK_PATH & DATABASE_FILENAME
Text1.Enabled = False
Command1.Enabled = False
Else
Check1.Enabled = False
ret = MsgBox("默认的备份文件不存在。" & vbCrLf & _
"要查找文件吗?", vbOKCancel + vbQuestion, Me.Caption)
If ret = vbOK Then
Call Command1_Click
End If
End If
Else
Text1.Enabled = True
Command1.Enabled = True
End If
End Sub
Private Sub Command1_Click()
CommonDialog1.FileName = ""
CommonDialog1.Flags = cdlOFNHideReadOnly
CommonDialog1.Filter = "Microsoft Access 数据库文件(*.mdb)|*.mdb"
CommonDialog1.DialogTitle = "查找源文件"
CommonDialog1.ShowOpen
Text1.Text = CommonDialog1.FileName
End Sub
Private Sub OKButton_Click()
Dim fs As Scripting.FileSystemObject
mFileName = Text1.Text
Set fs = CreateObject("Scripting.FileSystemObject")
If mFileName = "" Then
MsgBox "请输入源文件。", vbOKOnly + vbInformation, Me.Caption
Exit Sub
End If
If Not fs.FileExists(mFileName) Then
MsgBox "源文件'" & mFileName & "'不存在。请重新输入。", vbOKOnly + vbInformation, Me.Caption
Else
Unload Me
End If
End Sub
'取得文件路径及文件名
Public Property Get FileName() As String
FileName = mFileName
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -