frmDb.frm
上传用户:xianglong
上传日期:2022-06-19
资源大小:1105k
文件大小:7k
源码类别:

控制台编程

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  3. Begin VB.Form frmDb 
  4.    Caption         =   "物料Access数据备份恢复"
  5.    ClientHeight    =   6705
  6.    ClientLeft      =   60
  7.    ClientTop       =   420
  8.    ClientWidth     =   10110
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   6705
  13.    ScaleWidth      =   10110
  14.    StartUpPosition =   1  '所有者中心
  15.    Begin VB.CommandButton Command2 
  16.       Caption         =   "退出"
  17.       Height          =   375
  18.       Left            =   5040
  19.       TabIndex        =   11
  20.       Top             =   5880
  21.       Width           =   2895
  22.    End
  23.    Begin VB.CommandButton Command1 
  24.       Caption         =   "数据备份或数据回复"
  25.       Height          =   375
  26.       Left            =   1920
  27.       TabIndex        =   10
  28.       Top             =   5880
  29.       Width           =   2895
  30.    End
  31.    Begin VB.Frame Frame2 
  32.       Caption         =   "请选择数据库文件"
  33.       Height          =   4455
  34.       Left            =   5040
  35.       TabIndex        =   4
  36.       Top             =   600
  37.       Width           =   4935
  38.       Begin VB.FileListBox File1 
  39.          Height          =   1890
  40.          Left            =   120
  41.          TabIndex        =   8
  42.          Top             =   2400
  43.          Width           =   4695
  44.       End
  45.       Begin VB.DirListBox Dir1 
  46.          Height          =   1560
  47.          Left            =   120
  48.          TabIndex        =   7
  49.          Top             =   720
  50.          Width           =   4695
  51.       End
  52.       Begin VB.DriveListBox Drive1 
  53.          Height          =   300
  54.          Left            =   120
  55.          TabIndex        =   6
  56.          Top             =   360
  57.          Width           =   4695
  58.       End
  59.    End
  60.    Begin VB.Frame Frame1 
  61.       Caption         =   "备份卡列表"
  62.       Height          =   4455
  63.       Left            =   120
  64.       TabIndex        =   3
  65.       Top             =   600
  66.       Width           =   4695
  67.       Begin MSComctlLib.ListView ListView1 
  68.          Height          =   3975
  69.          Left            =   120
  70.          TabIndex        =   5
  71.          Top             =   360
  72.          Width           =   4455
  73.          _ExtentX        =   7858
  74.          _ExtentY        =   7011
  75.          LabelWrap       =   -1  'True
  76.          HideSelection   =   -1  'True
  77.          _Version        =   393217
  78.          Icons           =   "ImageList1"
  79.          ForeColor       =   -2147483640
  80.          BackColor       =   -2147483643
  81.          BorderStyle     =   1
  82.          Appearance      =   1
  83.          NumItems        =   0
  84.       End
  85.       Begin MSComctlLib.ImageList ImageList1 
  86.          Left            =   2880
  87.          Top             =   0
  88.          _ExtentX        =   1005
  89.          _ExtentY        =   1005
  90.          BackColor       =   -2147483643
  91.          ImageWidth      =   32
  92.          ImageHeight     =   32
  93.          MaskColor       =   12632256
  94.          _Version        =   393216
  95.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  96.             NumListImages   =   1
  97.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  98.                Picture         =   "frmDb.frx":0000
  99.                Key             =   "db"
  100.             EndProperty
  101.          EndProperty
  102.       End
  103.    End
  104.    Begin VB.OptionButton Option2 
  105.       Caption         =   "数据恢复"
  106.       Height          =   255
  107.       Left            =   8760
  108.       TabIndex        =   2
  109.       Top             =   120
  110.       Width           =   1095
  111.    End
  112.    Begin VB.OptionButton Option1 
  113.       Caption         =   "数据备份"
  114.       Height          =   255
  115.       Left            =   5160
  116.       TabIndex        =   1
  117.       Top             =   120
  118.       Width           =   1095
  119.    End
  120.    Begin MSComctlLib.StatusBar sbStatusBar 
  121.       Align           =   2  'Align Bottom
  122.       Height          =   270
  123.       Left            =   0
  124.       TabIndex        =   12
  125.       Top             =   6435
  126.       Width           =   10110
  127.       _ExtentX        =   17833
  128.       _ExtentY        =   476
  129.       SimpleText      =   "7"
  130.       _Version        =   393216
  131.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  132.          NumPanels       =   3
  133.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  134.             AutoSize        =   1
  135.             Object.Width           =   11853
  136.             Text            =   "Access2003数据库备份与恢复 "
  137.             TextSave        =   "Access2003数据库备份与恢复 "
  138.          EndProperty
  139.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  140.             Style           =   6
  141.             AutoSize        =   2
  142.             TextSave        =   "2007-6-7"
  143.          EndProperty
  144.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  145.             Style           =   5
  146.             AutoSize        =   2
  147.             Object.Width           =   2858
  148.             TextSave        =   "☆崔兆阳☆ 13:52"
  149.          EndProperty
  150.       EndProperty
  151.    End
  152.    Begin VB.Label Label1 
  153.       Height          =   255
  154.       Left            =   240
  155.       TabIndex        =   9
  156.       Top             =   5280
  157.       Width           =   9615
  158.    End
  159.    Begin VB.Label Label 
  160.       Caption         =   "请选择数据备份或回复选项:"
  161.       Height          =   255
  162.       Left            =   120
  163.       TabIndex        =   0
  164.       Top             =   120
  165.       Width           =   2535
  166.    End
  167. End
  168. Attribute VB_Name = "frmDb"
  169. Attribute VB_GlobalNameSpace = False
  170. Attribute VB_Creatable = False
  171. Attribute VB_PredeclaredId = True
  172. Attribute VB_Exposed = False
  173. Dim itmX, key As String
  174. Dim a As Integer
  175. Private Sub Command2_Click()
  176.   Unload Me
  177. End Sub
  178. Private Sub Form_Load()
  179.   Option1.Value = True
  180.   Dir1_Change
  181. End Sub
  182. Private Sub Dir1_Change()
  183.   File1.Path = Dir1.Path
  184.   ListView1.ListItems.Clear
  185.   If File1.ListCount <> 0 Then
  186.     a = 0
  187.     Do While File1.ListIndex < File1.ListCount - 1
  188.       File1.ListIndex = a
  189.       key = File1.filename
  190.       Set itmX = ListView1.ListItems.add(, , key, 1)
  191.       a = a + 1
  192.     Loop
  193.   End If
  194.   Label1.Caption = Dir1.Path & "" & File1.filename
  195. End Sub
  196. Private Sub Drive1_Change()
  197.   Dir1.Path = Drive1.Drive
  198. End Sub
  199. Private Sub File1_Click()
  200.   Label1.Caption = Dir1.Path & "" & File1.filename
  201. End Sub
  202. Private Sub Command1_Click()
  203.   If Option1.Value = True Then
  204.     If File1.ListCount <> 0 Then
  205.       FileCopy Trim(Label1.Caption), Date & "备份卡" & File1.filename
  206.       Me.MousePointer = 0
  207.       MsgBox "数据已经备份完毕!"
  208.       key = Date & "备份卡" & File1.filename
  209.       Set itmX = ListView1.ListItems.add(, , key, 1)
  210.     End If
  211.   End If
  212.   If Option2.Value = True Then
  213.     If File1.ListCount <> 0 Then
  214.        FileCopy ListView1.SelectedItem, File1.filename
  215.        Me.MousePointer = 0
  216.        MsgBox "数据已恢复完毕!"
  217.     Else
  218.        MsgBox "请选择要恢复的数据!"
  219.     End If
  220.   End If
  221. End Sub