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

📄 frmdatarestore.frm

📁 vb编出的关于传销工资结算系统
💻 FRM
字号:
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form frmDataRestore 
   Caption         =   "数据库恢复"
   ClientHeight    =   4440
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6195
   LinkTopic       =   "Form1"
   ScaleHeight     =   4440
   ScaleWidth      =   6195
   StartUpPosition =   2  '屏幕中心
   Begin ComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   855
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6195
      _ExtentX        =   10927
      _ExtentY        =   1508
      ButtonWidth     =   1455
      ButtonHeight    =   1349
      Appearance      =   1
      ImageList       =   "ImageList1"
      _Version        =   327682
      BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7} 
         NumButtons      =   5
         BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Caption         =   "数据恢复"
            Key             =   "Restore"
            Object.ToolTipText     =   "数据恢复"
            Object.Tag             =   ""
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   ""
            Object.Tag             =   ""
            Style           =   3
         EndProperty
         BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   ""
            Object.Tag             =   ""
            Style           =   3
         EndProperty
         BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   ""
            Object.Tag             =   ""
            Style           =   3
         EndProperty
         BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Caption         =   "退出"
            Key             =   "Close"
            Object.ToolTipText     =   "退出"
            Object.Tag             =   ""
            ImageIndex      =   2
         EndProperty
      EndProperty
   End
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   5550
      Top             =   10275
   End
   Begin VB.CommandButton cmdClose 
      Caption         =   "退出"
      Height          =   390
      Left            =   1950
      TabIndex        =   6
      Top             =   4050
      Visible         =   0   'False
      Width           =   840
   End
   Begin VB.CommandButton cmdRestore 
      Caption         =   "恢复"
      Height          =   390
      Left            =   900
      TabIndex        =   5
      Top             =   4050
      Visible         =   0   'False
      Width           =   840
   End
   Begin VB.FileListBox File1 
      BackColor       =   &H00C0FFFF&
      ForeColor       =   &H00FF0000&
      Height          =   2610
      Left            =   525
      TabIndex        =   4
      Top             =   1410
      Width           =   2235
   End
   Begin VB.DriveListBox Drive1 
      BackColor       =   &H00C0FFFF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   330
      Left            =   2865
      TabIndex        =   3
      Top             =   3690
      Width           =   2715
   End
   Begin VB.DirListBox Dir1 
      BackColor       =   &H00C0FFFF&
      ForeColor       =   &H00FF0000&
      Height          =   2610
      Left            =   2865
      TabIndex        =   2
      Top             =   1050
      Width           =   2715
   End
   Begin VB.TextBox txtFileName 
      BackColor       =   &H00C0FFFF&
      ForeColor       =   &H00FF0000&
      Height          =   300
      Left            =   525
      TabIndex        =   1
      Top             =   1050
      Width           =   2235
   End
   Begin ComctlLib.ImageList ImageList1 
      Left            =   75
      Top             =   3750
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   12632256
      _Version        =   327682
      BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
         NumListImages   =   2
         BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "frmDataRestore.frx":0000
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "frmDataRestore.frx":031A
            Key             =   ""
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmDataRestore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Fso As New FileSystemObject
Dim Fil As File
Dim TimeDelay As Integer
Dim BaseName As String
Dim Start As Boolean

Private Sub cmdClose_Click()
  Unload Me
  frmMain.Show
End Sub

Private Sub cmdRestore_Click()
  Dim FileExist As Boolean
  
  If txtFileName.Text = "" Then
     MsgBox "请选择恢复数据库!"
     Exit Sub
  End If
  
  If Right$(Dir1.Path, 1) = "\" Then
     BaseName = Dir1.Path + File1.FileName
  Else
     BaseName = Dir1.Path + "\" + File1.FileName
  End If
  
  FileExist = Fso.FileExists(BaseName)
  
  If FileExist = False Then
     MsgBox "指定的文件不存在,请重新选择数据库文件!"
     Exit Sub
  Else
     Start = True
     TimeDelay = 0
     frmWait.Show 1
  End If
End Sub

Private Sub Dir1_Change()
  File1.Path = Dir1.Path
  File1.Pattern = "*.mdb"
End Sub

Private Sub Drive1_Change()
  Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
  txtFileName.Text = File1.FileName
End Sub

Private Sub Form_Load()
  Drive1.Drive = "C:"
  Dir1.Path = "c:\system\database"
  TimeDelay = 0
  Start = False
End Sub

Private Sub Timer1_Timer()
  TimeDelay = TimeDelay + 1
  If TimeDelay >= 3 And Start = True Then
     Set Fil = Fso.GetFile(BaseName)
     Fil.Copy "C:\SYSTEM\DATABASE\SYSTEM.MDB", True
        
     Unload frmWait
     Start = False
     Exit Sub
  End If
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
  Select Case Button.Key
  Case "Restore"
    cmdRestore_Click
  Case "Close"
    cmdClose_Click
  End Select
End Sub

⌨️ 快捷键说明

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