📄 frm_sjbfyhf.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form frm_sjbf
BorderStyle = 3 'Fixed Dialog
Caption = "数据备份与恢复"
ClientHeight = 1680
ClientLeft = 45
ClientTop = 330
ClientWidth = 3750
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1680
ScaleWidth = 3750
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
Height = 270
Left = 360
TabIndex = 14
Top = 1920
Width = 2775
End
Begin VB.TextBox Text3
Height = 270
Left = 2160
TabIndex = 13
Text = "Text3"
Top = 4920
Width = 1215
End
Begin VB.CheckBox Check6
Caption = "Check6"
Height = 255
Left = 120
TabIndex = 12
Top = 4440
Width = 975
End
Begin VB.CheckBox Check5
Caption = "Check5"
Height = 255
Left = 4800
TabIndex = 11
Top = 4080
Width = 1095
End
Begin VB.CheckBox Check4
Caption = "Check4"
Height = 255
Left = 3600
TabIndex = 10
Top = 4080
Width = 975
End
Begin VB.CheckBox Check3
Caption = "Check3"
Height = 255
Left = 2520
TabIndex = 9
Top = 4080
Width = 855
End
Begin VB.CheckBox Check2
Caption = "Check2"
Height = 255
Left = 1440
TabIndex = 8
Top = 4080
Width = 855
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Left = 120
TabIndex = 7
Top = 3960
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2600
TabIndex = 4
Top = 1300
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "开始备份"
Height = 375
Left = 1470
TabIndex = 3
Top = 1300
Width = 1095
End
Begin VB.Frame Frame1
Height = 1215
Left = 80
TabIndex = 0
Top = 0
Width = 3620
Begin MSComDlg.CommonDialog CommonDialog1
Left = 2640
Top = 840
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton Command3
Caption = "<<"
Height = 310
Left = 3120
TabIndex = 6
Top = 480
Width = 375
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 300
Left = 120
TabIndex = 5
Top = 840
Width = 3375
_ExtentX = 5953
_ExtentY = 529
_Version = 393216
Appearance = 1
End
Begin VB.TextBox Text1
Height = 300
Left = 120
TabIndex = 2
Top = 480
Width = 3015
End
Begin VB.Label Label1
Caption = "选择数据库备份路径"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 120
TabIndex = 1
Top = 240
Width = 2535
End
End
End
Attribute VB_Name = "frm_sjbf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim StrCnn As New Connection '定义连接
Dim key, list, sql As String '定义字符串变量
Private Sub Command1_Click()
Command1.Enabled = False
If Text1.Text = "" Then
MsgBox "请您选择数据库备份的路径!", 64, "采购管理系统"
Else
Dim connter As Integer
Dim sql, workarea(15) As String
ProgressBar1.Visible = True
ProgressBar1.Max = UBound(workarea)
ProgressBar1.Value = ProgressBar1.Min
For connter = LBound(workarea) To UBound(workarea)
workarea(connter) = "initial value" & connter
ProgressBar1.Value = connter
StrCnn.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=Backup"
sql = "backup DATABASE Data_cggl TO disk='" & Text1.Text & "'"
StrCnn.Execute (sql) '执行SQL语句
StrCnn.Close
Next connter
ProgressBar1.Value = ProgressBar1.Min
MsgBox "数据库备份成功!"
Command1.Enabled = True
End If
frm_main.StatusBar1.Panels.Item(3).Text = frm_sjbf.Text4.Text
frm_main.Check1.Value = Check1.Value
frm_main.Check2.Value = Check2.Value
frm_main.Check3.Value = Check3.Value
frm_main.Check4.Value = Check4.Value
frm_main.Check5.Value = Check5.Value
frm_main.Check6.Value = Check6.Value
End Sub
Private Sub Command2_Click()
frm_main.StatusBar1.Panels.Item(3).Text = frm_sjbf.Text4.Text
frm_main.Check1.Value = Check1.Value
frm_main.Check2.Value = Check2.Value
frm_main.Check3.Value = Check3.Value
frm_main.Check4.Value = Check4.Value
frm_main.Check5.Value = Check5.Value
frm_main.Check6.Value = Check6.Value
frm_main.Show
Unload Me
End Sub
Private Sub Command3_Click()
CommonDialog1.Filter = "备份文件(*.bak)|*.bak|ALL File(*.*)|*.*"
CommonDialog1.ShowSave
Text1.Text = CommonDialog1.FileName
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
'Text3.Text = frm_main.Text1.Text
Check1.Value = frm_main.Check1.Value
Check2.Value = frm_main.Check2.Value
Check3.Value = frm_main.Check3.Value
Check4.Value = frm_main.Check4.Value
Check5.Value = frm_main.Check5.Value
Check6.Value = frm_main.Check6.Value
'Unload frm_main
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.StatusBar1.Panels(1).Text = " 吉林省明日科技有限公司"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -