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

📄 frm_数据库恢复.frm

📁 计量器具管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form Frm_数据库恢复 
   Caption         =   "数据恢复"
   ClientHeight    =   2700
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5145
   Icon            =   "Frm_数据库恢复.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   2700
   ScaleWidth      =   5145
   StartUpPosition =   3  '窗口缺省
   Begin MSComDlg.CommonDialog CDialog 
      Left            =   4710
      Top             =   2295
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.PictureBox Picture2 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   2715
      Left            =   3645
      ScaleHeight     =   2685
      ScaleWidth      =   1485
      TabIndex        =   1
      Top             =   0
      Width           =   1515
      Begin VB.CommandButton SNXpEXIT 
         Caption         =   "退    出"
         Height          =   495
         Left            =   120
         TabIndex        =   5
         Top             =   1680
         Width           =   1215
      End
      Begin VB.CommandButton SNXpRESTORE 
         Caption         =   "数据恢复"
         Height          =   495
         Left            =   120
         TabIndex        =   4
         Top             =   720
         Width           =   1215
      End
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   2715
      Left            =   -30
      ScaleHeight     =   2685
      ScaleWidth      =   3660
      TabIndex        =   0
      Top             =   0
      Width           =   3690
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         Caption         =   "远望提示您"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF00FF&
         Height          =   315
         Left            =   465
         TabIndex        =   3
         Top             =   285
         Width           =   2685
      End
      Begin VB.Label Label1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         Caption         =   $"Frm_数据库恢复.frx":030A
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800080&
         Height          =   1725
         Left            =   330
         TabIndex        =   2
         Top             =   630
         Width           =   3075
      End
      Begin VB.Shape Shape2 
         BorderColor     =   &H00FF8080&
         Height          =   2505
         Left            =   90
         Top             =   90
         Width           =   3480
      End
      Begin VB.Shape Shape1 
         BorderColor     =   &H00FF8080&
         Height          =   2625
         Left            =   30
         Top             =   30
         Width           =   3600
      End
   End
End
Attribute VB_Name = "Frm_数据库恢复"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim SQLString As String
Private Sub SNXpBACKUP_Click()   '''' 备份
    CDialog.CancelError = True
    CDialog.Filter = "Microsoft Access数据库(*.mdb)|*.mdb"

On Error GoTo ERR:
    CDialog.Action = 2
    If Trim(CDialog.FileName) = "" Then Exit Sub
    Set fsodata = CreateObject("Scripting.FileSystemObject")
    If IsNull(fsodata) = True Then
        MsgBox "文件系统错误!", vbInformation, "计量器具管理系统——错误信息"
        Unload Me
        Exit Sub
    End If
    fsodata.copyfile App.Path + "\MEMS.mdb", CDialog.FileName, True
    MsgBox "备份数据成功!!", vbInformation, "济宁远望提示"
    Exit Sub
ERR:
    MsgBox ERR.Description, vbInformation, "提示"
    Exit Sub
End Sub

Private Sub SNXpEXIT_Click()
    Unload Me
End Sub


Private Sub SNXpRESTORE_Click()    ''''恢复
    ' 设置“CancelError”为 True
    CDialog.CancelError = True
    
    ' 设置过滤器
    CDialog.Filter = "Microsoft Access数据库(*.mdb)|*.mdb"
On Error GoTo ERR:
    CDialog.Action = 1
    If Trim(CDialog.FileName) = "" Then Exit Sub
    Set fsodata = CreateObject("Scripting.FileSystemObject")
    If IsNull(obj) = True Then
            MsgBox "文件系统错误!", vbInformation, "计量器具管理系统——错误信息"
            Unload Me
            Exit Sub
    End If
    fsodata.copyfile CDialog.FileName, App.Path + "\mems.mdb", True
    MsgBox "数据恢复成功!!", vbInformation, "远望提示"
    SQLString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\MEMS.mdb;Persist Security Info=False;Jet OLEDB"
    If Conn.State = 1 Then Conn.Close
    Conn.ConnectionString = SQLString
    Conn.Open
    Exit Sub
ERR:
    MsgBox ERR.Description, vbInformation, "提示"
    Exit Sub
End Sub

Private Sub Form_Load()
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) * (1 - 0.618)
End Sub




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -