?? form1.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form1
Caption = "壓縮數(shù)據(jù)庫(kù)文件"
ClientHeight = 2055
ClientLeft = 60
ClientTop = 345
ClientWidth = 4470
LinkTopic = "Form1"
ScaleHeight = 2055
ScaleWidth = 4470
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command3
Caption = "退出"
Height = 495
Left = 3000
TabIndex = 4
Top = 1335
Width = 1320
End
Begin VB.CheckBox Check1
Appearance = 0 'Flat
BackColor = &H80000004&
Caption = "壓縮前請(qǐng)備份數(shù)據(jù)庫(kù)"
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 = "開(kāi)始?jí)嚎s"
Height = 525
Left = 360
Style = 1 'Graphical
TabIndex = 0
Top = 1350
Width = 2595
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "要修復(fù)的數(shù)據(jù)庫(kù)"
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
MousePointer = 11
sNewFile = Left$(sDatabase, Len(sDatabase) - 3) & "NEW"
sBakFile = Left$(sDatabase, Len(sDatabase) - 3) & "BAK"
If Check1.Value = 1 Then
Name sDatabase As sBakFile '備份數(shù)據(jù)庫(kù)
End If
DBEngine.RepairDatabase sDatabase '修復(fù)數(shù)據(jù)庫(kù)
If Dir(sNewFile) <> "" Then
Kill sNewFile
End If
DBEngine.CompactDatabase sDatabase, sNewFile '壓縮數(shù)據(jù)庫(kù)
If Dir(sBakFile) <> "" Then
Kill sBakFile
End If
If Dir(sDatabase) <> "" Then
Kill sDatabase
End If
Name sNewFile As sDatabase
bCompactMDB = True
MousePointer = 0
MousePointer = 0
MsgBox "壓縮數(shù)據(jù)庫(kù)完成"
End Sub
Private Sub Command3_Click()
End
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -