form2.frm
来自「网络图书管理系统设计是为了图书馆管理员可以方便的对图书」· FRM 代码 · 共 75 行
FRM
75 行
VERSION 5.00
Begin VB.Form Form2
Caption = "备份与恢复"
ClientHeight = 5085
ClientLeft = 60
ClientTop = 450
ClientWidth = 7875
LinkTopic = "Form2"
ScaleHeight = 5085
ScaleWidth = 7875
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
Height = 855
Left = 4800
TabIndex = 3
Top = 3360
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "备份"
Height = 855
Left = 4800
TabIndex = 2
Top = 480
Width = 2295
End
Begin VB.CommandButton Command1
Caption = "恢复"
Height = 735
Left = 4800
TabIndex = 1
Top = 2040
Width = 2295
End
Begin VB.Frame Frame1
Caption = "信息"
Height = 4215
Left = 360
TabIndex = 0
Top = 360
Width = 3615
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
Dim sql As String
Nowtime = Format(Now, "hh-mm-ss")
dd = Str(Date)
riqi = dd + "-" + Nowtime
sql = "BACKUP DATABASE stu TO disk='C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\book" & riqi & "' with noinit"
Ex_Sql (sql)
MsgBox "备份成功", vbOKOnly + vbExclamation, "恭喜"
End Sub
Private Sub Command1_Click()
Dim sql As String
succ = re_dl("book", "sa", "")
If Not (succ) Then
MsgBox "连接远程数据库失败", 0, "系统提示"
Exit Sub
End If
sql = "restore database stu from disk='C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\book" & riqi & "' "
Ex_Sql (sql)
MsgBox "恢复成功", vbOKOnly + vbExclamation, "恭喜"
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?