?? frm_restore.frm
字號:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm_restore
Caption = "數據恢復"
ClientHeight = 3765
ClientLeft = 60
ClientTop = 345
ClientWidth = 5385
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3765
ScaleWidth = 5385
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture2
Height = 3240
Left = 45
Picture = "frm_restore.frx":0000
ScaleHeight = 3180
ScaleWidth = 1755
TabIndex = 8
Top = 75
Width = 1815
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 510
Top = 2640
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 120
Top = 4560
Visible = 0 'False
Width = 2175
_ExtentX = 3836
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from tb_enter"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text3
Height = 270
Left = 3120
TabIndex = 2
Text = "Text3"
Top = 5400
Width = 1215
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取消"
Height = 375
Left = 4260
TabIndex = 0
Top = 3375
Width = 1095
End
Begin VB.CommandButton Cmd_Ok
Caption = "開始恢復"
Height = 375
Left = 3135
TabIndex = 1
Top = 3375
Width = 1095
End
Begin VB.Frame Frame2
Height = 3360
Left = 1920
TabIndex = 3
Top = -30
Width = 3435
Begin VB.TextBox Txt_restore
Height = 300
Left = 210
TabIndex = 6
Top = 2460
Width = 2655
End
Begin VB.CommandButton Cmd_select
Caption = "<<"
Height = 300
Left = 2835
TabIndex = 5
Top = 2475
Width = 375
End
Begin MSComctlLib.ProgressBar ProgressBar2
Height = 300
Left = 210
TabIndex = 4
Top = 2880
Width = 3015
_ExtentX = 5318
_ExtentY = 529
_Version = 393216
Appearance = 1
End
Begin VB.Label Label3
Caption = "單擊“<<”圖標按鈕,選擇以前備份的數據庫路徑,然后單擊“開始恢復”按鈕開始恢復數據"
Height = 615
Index = 0
Left = 345
TabIndex = 9
Top = 870
Width = 2775
End
Begin VB.Label Label2
Caption = "選擇數據庫恢復的路徑"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 300
Left = 210
TabIndex = 7
Top = 2070
Width = 2415
End
End
End
Attribute VB_Name = "frm_restore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim StrCnn As New Connection '定義連接
Dim key, list, sql, Temp, Intext As String '定義字符串變量
Private Sub Cmd_Ok_Click()
If Txt_restore.Text = "" Then
MsgBox "請您選擇數據庫恢復的路徑!", 64, "提示信息"
Else
Me.MousePointer = 11
Cmd_Ok.Enabled = False
Dim connter As Integer
Dim sql, workarea(12) As String
ProgressBar2.Visible = True
ProgressBar2.Max = UBound(workarea)
ProgressBar2.Value = ProgressBar2.Min
For connter = LBound(workarea) To UBound(workarea)
workarea(connter) = "initial value" & connter
ProgressBar2.Value = connter
StrCnn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=master"
sql = "use master RESTORE DATABASE Data_ZYGL from disk='" & Txt_restore.Text & "'"
StrCnn.Execute (sql) '執行SQL語句
StrCnn.Close
Next connter
ProgressBar2.Value = ProgressBar2.Min
MsgBox "數據庫恢復成功!!", 64, "提示信息"
Cmd_Ok.Enabled = True
Me.MousePointer = 0
End If
End Sub
Private Sub Cmd_select_Click()
CommonDialog1.Filter = "備份文件(*.bak)|*.bak|文本文件(*.txt)|*.txt|ALL File(*.*)|*.*"
CommonDialog1.ShowOpen
Txt_restore.Text = CommonDialog1.FileName
End Sub
Private Sub Cmd_Cancel_Click()
End
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 + -