?? form2.frm
字號:
VERSION 5.00
Begin VB.Form Form2
Caption = "備份與恢復(fù)"
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 = "恢復(fù)"
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 "連接遠(yuǎn)程數(shù)據(jù)庫失敗", 0, "系統(tǒng)提示"
Exit Sub
End If
sql = "restore database stu from disk='C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\book" & riqi & "' "
Ex_Sql (sql)
MsgBox "恢復(fù)成功", vbOKOnly + vbExclamation, "恭喜"
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -