?? restore.frm
字號(hào):
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form restore
Caption = "數(shù)據(jù)備份和數(shù)據(jù)恢復(fù)"
ClientHeight = 8265
ClientLeft = 60
ClientTop = 450
ClientWidth = 8475
LinkTopic = "Form1"
ScaleHeight = 8265
ScaleWidth = 8475
StartUpPosition = 3 '窗口缺省
Begin MSComctlLib.ImageList ImageList1
Left = 240
Top = 7080
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "restore.frx":0000
Key = ""
EndProperty
EndProperty
End
Begin VB.CommandButton CmdEnd
Caption = "退出"
Height = 615
Left = 4440
TabIndex = 11
Top = 7200
Width = 2415
End
Begin VB.CommandButton CmdBackup
Caption = "數(shù)據(jù)備份或數(shù)據(jù)恢復(fù)"
Height = 615
Left = 1320
TabIndex = 10
Top = 7200
Width = 2415
End
Begin VB.Frame Frame2
Caption = "請(qǐng)選擇數(shù)據(jù)庫(kù)路徑:"
Height = 4575
Left = 3600
TabIndex = 5
Top = 1560
Width = 4335
Begin VB.DirListBox Dir1
Height = 930
Left = 120
TabIndex = 8
Top = 1320
Width = 4000
End
Begin VB.FileListBox File1
Height = 1710
Left = 120
Pattern = "*.BAK"
TabIndex = 7
Top = 2640
Width = 4000
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 120
TabIndex = 6
Top = 480
Width = 4000
End
End
Begin VB.Frame Frame1
Caption = "備份卡列表:"
Height = 4575
Left = 360
TabIndex = 3
Top = 1560
Width = 2895
Begin MSComctlLib.ListView ListView1
Height = 3975
Left = 120
TabIndex = 4
Top = 360
Width = 2600
_ExtentX = 4577
_ExtentY = 7011
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
Icons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
End
Begin VB.OptionButton Option2
Caption = "數(shù)據(jù)恢復(fù)"
Height = 495
Left = 6120
TabIndex = 2
Top = 600
Width = 1215
End
Begin VB.OptionButton Option1
Caption = "數(shù)據(jù)備份"
Height = 495
Left = 3720
TabIndex = 1
Top = 600
Width = 1215
End
Begin VB.Label Label2
Caption = "Label2"
Height = 495
Left = 360
TabIndex = 9
Top = 6240
Width = 7575
End
Begin VB.Label Label1
Caption = "請(qǐng)選擇數(shù)據(jù)備份或數(shù)據(jù)恢復(fù)選項(xiàng):"
Height = 615
Left = 480
TabIndex = 0
Top = 720
Width = 2895
End
End
Attribute VB_Name = "restore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim StrCnn As New ADODB.Connection
Dim itmx As ListItem
Dim key, list, sql As String
Private Sub CmdBackup_Click()
Dim S
If Option1.Value = True Then
S = Dir1.Path & "\" & Date & " .BAK"
If Label2.Caption = S Then
MsgBox "數(shù)據(jù)備份卡已存在!"
Else
StrCnn.Open "FileDSN=Backup.dsn;UID=sa;PWD="
sql = "backup database wanghe to disk='" & S & "'"
StrCnn.Execute (sql)
StrCnn.Close
MsgBox "數(shù)據(jù)庫(kù)備份成功!"
key = Date & " .BAK"
Set itmx = ListView1.ListItems.Add(, , key, 1)
End If
End If
If Option2.Value = True Then
If File1.ListCount <> 0 Then
If Label2.Caption <> "" Then
StrCnn.Open "FileDSN=Backup.dsn;UID=sa;PWD="
sql = "restore database store from disk='" & Label2.Caption & " ' "
StrCnn.Execute (sql)
StrCnn.Close
MsgBox "數(shù)據(jù)庫(kù)恢復(fù)成功!"
Else
MsgBox "請(qǐng)選擇要恢復(fù)的數(shù)據(jù)備份卡!"
End If
Else
MsgBox "請(qǐng)選擇要恢復(fù)的數(shù)據(jù)備份卡!"
End If
End If
End Sub
Private Sub CmdEnd_Click()
restore.Hide
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
ListView1.ListItems.Clear
If File1.ListCount <> 0 Then
a = 0
Do While File1.ListIndex < File1.ListCount - 1
File1.ListIndex = a
key = File1.FileName
Set itmx = ListView1.ListItems.Add(, , key, 1)
a = a + 1
Loop
End If
File1_Click
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Label2.Caption = Dir1.Path & "\" & File1.FileName
End Sub
Private Sub Form_Load()
Option1.Value = True
Dir1_Change
End Sub
Private Sub ListView1_Click()
Label2.Caption = Dir1.Path & "\" & ListView1.SelectedItem
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -