📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "修复数据库文件"
ClientHeight = 2055
ClientLeft = 60
ClientTop = 345
ClientWidth = 4470
LinkTopic = "Form1"
ScaleHeight = 2055
ScaleWidth = 4470
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
Height = 525
Left = 3000
TabIndex = 4
Top = 1335
Width = 1320
End
Begin VB.CheckBox Check1
Appearance = 0 'Flat
BackColor = &H80000004&
Caption = "修复前请备份数据库"
ForeColor = &H80000008&
Height = 300
Left = 120
TabIndex = 3
Top = 945
Value = 1 'Checked
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
Left = 120
TabIndex = 1
Text = "Text1"
Top = 480
Width = 4140
End
Begin VB.CommandButton Command1
Caption = "开始修复"
Height = 525
Left = 240
Style = 1 'Graphical
TabIndex = 0
Top = 1335
Width = 2595
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "要修复的数据库"
Height = 180
Left = 135
TabIndex = 2
Top = 150
Width = 1260
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Text1.Text = App.Path & "\db1.mdb"
End Sub
Private Sub Command1_Click()
On Error Resume Next
Dim sNewName As String
Dim sBakFile As String
sNewName = Text1.Text
sDatabase = sNewName
brepairMDB = False
MousePointer = 11
sBakFile = Left$(sDatabase, Len(sDatabase) - 3) & "BAK"
If Check1.Value = 1 Then
FileCopy sDatabase, sBakFile '备份数据库
End If
DBEngine.RepairDatabase sDatabase '修复数据库
MousePointer = 0
MsgBox "修复完成"
End Sub
Private Sub Command3_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -