📄 form20.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 Form20
BackColor = &H00C0C0FF&
BorderStyle = 1 'Fixed Single
Caption = "数据安全管理"
ClientHeight = 3540
ClientLeft = 45
ClientTop = 345
ClientWidth = 6180
LinkTopic = "Form20"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3540
ScaleWidth = 6180
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog CommonDialog1
Left = 1620
Top = 3615
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame1
BackColor = &H00C0C0FF&
Height = 2580
Left = 345
TabIndex = 0
Top = 345
Width = 4455
Begin VB.CommandButton cmd_1
BackColor = &H00C0E0FF&
Cancel = -1 'True
Caption = "返回(&A)"
Height = 375
Left = 2400
Style = 1 'Graphical
TabIndex = 6
Top = 1995
Width = 1155
End
Begin VB.CommandButton cmd_backup
BackColor = &H00C0E0FF&
Caption = "开始备份(&B)"
Default = -1 'True
Height = 375
Left = 765
Style = 1 'Graphical
TabIndex = 5
Top = 1980
Width = 1155
End
Begin VB.CommandButton Command1
BackColor = &H0000FFFF&
Caption = "<<"
Height = 300
Left = 3705
Style = 1 'Graphical
TabIndex = 4
Top = 390
Width = 495
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 270
Left = 285
TabIndex = 3
Top = 1470
Width = 3825
_ExtentX = 6747
_ExtentY = 476
_Version = 393216
Appearance = 1
End
Begin VB.TextBox Text1
BackColor = &H00FFC0C0&
ForeColor = &H000000FF&
Height = 270
Left = 285
TabIndex = 2
Top = 855
Width = 3825
End
Begin VB.Label Label1
BackColor = &H00C0FFC0&
Caption = "请输入或者选择数据库备份的路径"
ForeColor = &H000000FF&
Height = 285
Left = 360
TabIndex = 1
Top = 375
Width = 2715
End
End
End
Attribute VB_Name = "Form20"
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 cmd_1_Click()
Unload Me
End Sub
Private Sub cmd_backup_Click()
If Text1.Text = "" Then
MsgBox "请您选择数据库备份的路径!", 64, "设备管理系统"
Else
cmd_1.Enabled = False
Command1.Enabled = False
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
adoCon.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test;Data Source=(local)"
sql = "backup DATABASE test TO disk='" & Text1.Text & "'"
adoCon.Execute (sql) '执行SQL语句
adoCon.Close
' 'MsgBox connter
' Next connter
ProgressBar1.Value = ProgressBar1.Min
MsgBox "数据库备份成功!", 64
Command1.Enabled = True
cmd_1.Enabled = True
End If
End Sub
Private Sub Command1_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
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -