📄 dbbackup.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "数据库维护"
ClientHeight = 4005
ClientLeft = 60
ClientTop = 345
ClientWidth = 6210
LinkTopic = "Form1"
ScaleHeight = 4005
ScaleWidth = 6210
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 480
Left = 360
Picture = "dbbackup.frx":0000
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 11
Top = 240
Width = 480
End
Begin VB.CommandButton cmdquit
Caption = "退 出"
Height = 375
Left = 4560
TabIndex = 9
Top = 3360
Width = 1455
End
Begin VB.CommandButton cmdrepair
Caption = "修 复"
Height = 375
Left = 2400
TabIndex = 8
Top = 3360
Width = 1455
End
Begin VB.CommandButton cmdproperty
Caption = "属 性"
Height = 375
Left = 120
TabIndex = 7
Top = 3360
Width = 1455
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 5400
Top = 2160
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton cmdcompact
Caption = "数据压缩"
Height = 375
Left = 4560
TabIndex = 6
Top = 1560
Width = 1455
End
Begin VB.OptionButton optchinese
Caption = "中文"
Height = 495
Left = 2520
TabIndex = 4
Top = 2040
Width = 1215
End
Begin VB.OptionButton optenglish
Caption = "英文"
Height = 495
Left = 2520
TabIndex = 3
Top = 1440
Value = -1 'True
Width = 1215
End
Begin VB.CheckBox chkpassword
Caption = "是否进行加密"
Height = 495
Left = 240
TabIndex = 1
Top = 2160
Width = 1575
End
Begin VB.TextBox txtpassword
Height = 375
IMEMode = 3 'DISABLE
Left = 240
PasswordChar = "*"
TabIndex = 0
Top = 1560
Width = 1455
End
Begin VB.Label Label3
Caption = "首先选择要压缩的数据库,然后再指定目标数据库,再根据选定的是否使用加密和压缩国别,完成对数据库的压缩"
Height = 615
Left = 2160
TabIndex = 10
Top = 240
Width = 3855
End
Begin VB.Label Label2
Caption = "指明压缩数据库国别"
Height = 375
Left = 2160
TabIndex = 5
Top = 960
Width = 1695
End
Begin VB.Label Label1
Caption = "密码"
Height = 255
Left = 240
TabIndex = 2
Top = 1200
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub chkpassword_Click()
If chkpassword Then
txtpassword.Enabled = True
Else
txtpassword.Enabled = False
End If
End Sub
Private Sub cmdcompact_Click()
CommonDialog1.Filter = "*.mdb|*.mdb"
CommonDialog1.FontName = vbnulstring
CommonDialog1.ShowOpen
Dim intlanguage As Variant
Dim strnew, strold, strpassword As String
If Len(CommonDialog1.FileName) > 0 Then
strold = CommonDialog1.FileName
Else
Exit Sub
End If
CommonDialog1.Filter = "*.mdb|*.mdb"
CommonDialog1.DialogTitle = "select destine file"
CommonDialog1.FileName = vbNullString
CommonDialog1.ShowOpen
If Len(CommonDialog1.FileName) > 0 Then
strnew = CommonDialog1.FileName
If Dir(strnew) <> vbNullString And strnew <> strold Then
Kill strnew
End If
Else
Exit Sub
End If
If optenglish Then
intlanguage = dbLangGeneral
Else
intlanguage = dblangcinesesimplified
End If
If chkpassword Then
DBEngine.CompactDatabase strold, strnew, intlanguage, dbdncrypt + dbVersion30
Else
DBEngine.CompactDatabase strold, strnew, intlanguage, dbEncrypt + dbVersion30, txtpassword
End If
End Sub
Private Sub cmdproperty_Click()
Dim str As String
Dim myproperty As Property
For Each myproperty In DBEngine.Properties
On Error Resume Next
str = str & myproperty.Name & "=" & myproperty.Value & Chr$(13)
Next
MsgBox str
End Sub
Private Sub cmdquit_Click()
End
End Sub
Private Sub cmdrepair_Click()
CommonDialog1.Filter = "*.mdb|*.mdb"
CommonDialog1.FileName = vbNullString
CommonDialog1.DialogTitle = "select file to repair"
CommonDialog1.ShowOpen
If Len(CommonDialog1.FileName) > 0 Then
DBEngine.RepairDatabase CommonDialog1.FileName
End If
End Sub
Private Sub Form_Load()
txtpassword.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -