⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_restore.frm

📁 近期学习中的采购管理系统
💻 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    =   2115
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3420
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   2115
   ScaleWidth      =   3420
   StartUpPosition =   3  '窗口缺省
   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            =   2250
      TabIndex        =   0
      Top             =   1695
      Width           =   1095
   End
   Begin VB.CommandButton Cmd_Ok 
      Caption         =   "开始恢复"
      Height          =   375
      Left            =   1095
      TabIndex        =   1
      Top             =   1695
      Width           =   1095
   End
   Begin VB.Frame Frame2 
      Height          =   1530
      Left            =   75
      TabIndex        =   3
      Top             =   120
      Width           =   3270
      Begin VB.TextBox Txt_restore 
         Height          =   300
         Left            =   120
         TabIndex        =   6
         Top             =   645
         Width           =   2655
      End
      Begin VB.CommandButton Cmd_select 
         Caption         =   "<<"
         Height          =   300
         Left            =   2745
         TabIndex        =   5
         Top             =   660
         Width           =   375
      End
      Begin MSComctlLib.ProgressBar ProgressBar2 
         Height          =   300
         Left            =   120
         TabIndex        =   4
         Top             =   1065
         Width           =   2985
         _ExtentX        =   5265
         _ExtentY        =   529
         _Version        =   393216
         Appearance      =   1
      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            =   135
         TabIndex        =   7
         Top             =   315
         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_cggl 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 + -