📄 frmbackup.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmbackup
BorderStyle = 1 'Fixed Single
Caption = "备份数据库"
ClientHeight = 5205
ClientLeft = 45
ClientTop = 330
ClientWidth = 8685
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5205
ScaleWidth = 8685
Begin VB.CommandButton Command4
Caption = "关闭"
Height = 375
Left = 3840
TabIndex = 8
Top = 4440
Width = 855
End
Begin MSComDlg.CommonDialog CommonDialog2
Left = 1800
Top = 3360
_ExtentX = 847
_ExtentY = 847
_Version = 393216
FileName = "dbbackup.mdb"
Filter = "数据库文件(*.mdb)|*.mdb"
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 5520
Top = 3480
_ExtentX = 847
_ExtentY = 847
_Version = 393216
Filter = "数据库文件(*.mdb)|*.mdb"
End
Begin VB.CommandButton Command3
Caption = "备份"
BeginProperty Font
Name = "黑体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 7080
Style = 1 'Graphical
TabIndex = 4
Top = 1440
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "选择"
Height = 375
Left = 5760
TabIndex = 3
Top = 2160
Width = 855
End
Begin VB.CommandButton Command1
Caption = "选择"
Height = 375
Left = 5760
TabIndex = 2
Top = 1440
Width = 855
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 1
Top = 2160
Width = 3855
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 0
Top = 1440
Width = 3855
End
Begin VB.Image Image1
Height = 525
Left = 2760
Picture = "frmbackup.frx":0000
Top = 240
Width = 765
End
Begin VB.Label Label4
Caption = "备份数据库"
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 9
Top = 360
Width = 3735
End
Begin VB.Shape Shape1
Height = 855
Left = 360
Top = 120
Width = 4335
End
Begin VB.Line Line2
X1 = 0
X2 = 8640
Y1 = 3960
Y2 = 3960
End
Begin VB.Line Line1
X1 = 0
X2 = 8640
Y1 = 3240
Y2 = 3240
End
Begin VB.Label Label3
Caption = "·请经常备份数据库,以确保数据不丢失。"
ForeColor = &H00000080&
Height = 255
Left = 2640
TabIndex = 7
Top = 3480
Width = 3255
End
Begin VB.Label Label2
Caption = "保存:"
Height = 255
Left = 480
TabIndex = 6
Top = 2280
Width = 1095
End
Begin VB.Label Label1
Caption = "打开:"
Height = 255
Left = 480
TabIndex = 5
Top = 1560
Width = 1095
End
End
Attribute VB_Name = "frmbackup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
CommonDialog1.ShowOpen
Text1.Text = CommonDialog1.FileName
End Sub
Private Sub Command2_Click()
If Text1.Text = "" Then
MsgBox "请先选择数据库文件", , "警告"
Else
CommonDialog2.ShowSave
Text2.Text = CommonDialog2.FileName
End If
End Sub
Private Sub Command3_Click()
Dim src As String
Dim dst As String
If Text1.Text = "" Then
MsgBox "请选择数据库源文件", , "警告"
Else
If Text2.Text = "" Then
MsgBox "请选择备份数据库存放目录", , "警告"
End If
End If
If Text1.Text <> "" And Text2.Text <> "" Then
src = Text1.Text
dst = Text2.Text
FileCopy src, dst
MsgBox "数据库备份成功!", , "提示"
End If
End Sub
Private Sub Command4_Click()
Unload frmbackup
'初始化主窗口
mainfrm.guanli.Enabled = True
mainfrm.chaxun.Enabled = True
mainfrm.tongji.Enabled = True
If userid = "admin" Then
mainfrm.xitong.Enabled = True
mainfrm.bdb.Enabled = True
Else
mainfrm.xitong.Enabled = False
mainfrm.bdb.Enabled = False
End If
mainfrm.Command1.Enabled = True
mainfrm.Command2.Enabled = True
mainfrm.Command3.Enabled = True
If userid = "admin" Then
mainfrm.Command4.Enabled = True
Else
mainfrm.Command4.Enabled = False
End If
GetStatus "<就绪>"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -