Form_BakDataBase.frm
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:4k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form Frm_Bakdatabase 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "套帐备份"
  5.    ClientHeight    =   5175
  6.    ClientLeft      =   3915
  7.    ClientTop       =   2205
  8.    ClientWidth     =   6030
  9.    HelpContextID   =   1017
  10.    Icon            =   "Form_BakDataBase.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   5175
  16.    ScaleWidth      =   6030
  17.    StartUpPosition =   2  '屏幕中心
  18.    Begin VB.CommandButton Command2 
  19.       Height          =   315
  20.       Left            =   5625
  21.       Picture         =   "Form_BakDataBase.frx":038A
  22.       Style           =   1  'Graphical
  23.       TabIndex        =   8
  24.       Top             =   600
  25.       Width           =   315
  26.    End
  27.    Begin VB.TextBox Text2 
  28.       Height          =   285
  29.       Left            =   3360
  30.       MaxLength       =   15
  31.       TabIndex        =   0
  32.       Top             =   600
  33.       Width           =   2205
  34.    End
  35.    Begin VB.CommandButton Command1 
  36.       Caption         =   "取消&C"
  37.       Height          =   345
  38.       Index           =   1
  39.       Left            =   3600
  40.       TabIndex        =   6
  41.       Top             =   4275
  42.       Width           =   2205
  43.    End
  44.    Begin VB.Frame Frame1 
  45.       Caption         =   "备份文件路径:"
  46.       Height          =   4920
  47.       Left            =   60
  48.       TabIndex        =   2
  49.       Top             =   150
  50.       Width           =   3255
  51.       Begin VB.TextBox Text1 
  52.          Height          =   285
  53.          Left            =   90
  54.          Locked          =   -1  'True
  55.          TabIndex        =   5
  56.          Top             =   210
  57.          Width           =   3075
  58.       End
  59.       Begin VB.DriveListBox Drive1 
  60.          Appearance      =   0  'Flat
  61.          Height          =   300
  62.          Left            =   90
  63.          TabIndex        =   4
  64.          Top             =   600
  65.          Width           =   3075
  66.       End
  67.       Begin VB.DirListBox Dir1 
  68.          Height          =   3660
  69.          Left            =   90
  70.          TabIndex        =   3
  71.          Top             =   990
  72.          Width           =   3075
  73.       End
  74.    End
  75.    Begin VB.CommandButton Command1 
  76.       Caption         =   "确定&D"
  77.       Height          =   345
  78.       Index           =   0
  79.       Left            =   3555
  80.       TabIndex        =   1
  81.       Top             =   3750
  82.       Width           =   2205
  83.    End
  84.    Begin VB.Label Label1 
  85.       Caption         =   "备份文件名:"
  86.       Height          =   225
  87.       Left            =   3390
  88.       TabIndex        =   7
  89.       Top             =   270
  90.       Width           =   1125
  91.    End
  92. End
  93. Attribute VB_Name = "Frm_Bakdatabase"
  94. Attribute VB_GlobalNameSpace = False
  95. Attribute VB_Creatable = False
  96. Attribute VB_PredeclaredId = True
  97. Attribute VB_Exposed = False
  98. Private Sub Command1_Click(Index As Integer)
  99. On Error Resume Next
  100. If Index = 1 Then Unload Me: Exit Sub
  101. If Trim(Text2.Text) = "" Then MsgBox "备份文件名不能为空! ", 16: Text2.SetFocus: Exit Sub
  102. If Trim(Text1.Text) = "" Then MsgBox "备份文件路径不能为空! ", 16: Dir1.SetFocus: Exit Sub
  103. Class.StatusBar "套帐正在备份...", False
  104. Me.MousePointer = 12
  105. Dim Error_int As Integer
  106. If Len(Trim(Text1.Text)) = 3 Then Text1.Text = Mid(Trim(Text1.Text), 1, 2)
  107. Cw_DataEnvi.dbo_HD_BakDatabase Text1.Tag, Trim(Text1.Text), Trim(Text2.Text), Error_int
  108. Class.StatusBar "", True
  109. Me.MousePointer = 0
  110. If Error_int = 1 Then
  111.    Form_main.Form_Load
  112.    MsgBox "成功创建备份文件! " & Chr(13) & Text1.Text & "" & Text2.Text & ".Bak", 48
  113.    Unload Me
  114.    Else
  115.    If Error_int = -1 Then
  116.    MsgBox "备份文件创建失败!  ", 16
  117.    End If
  118. End If
  119. If Err <> 0 Then
  120. MsgBox Err.Description, 16
  121. Class.StatusBar "", True
  122. Me.MousePointer = 0
  123. End If
  124. End Sub
  125. Private Sub Command2_Click()
  126.     Frm_BakFile.Show 1
  127.     If Trim(BakFile) <> "" Then
  128.         Text2.Text = BakFile
  129.         
  130.         Drive1.Drive = BakFilePath
  131.         Dir1.Path = BakFilePath
  132.         Text1.Text = BakFilePath
  133.     End If
  134. End Sub
  135. Private Sub Dir1_Change()
  136. Text1.Text = Dir1.Path
  137. End Sub
  138. Private Sub Drive1_Change()
  139. On Error Resume Next
  140. Dir1.Path = Drive1.Drive
  141. If Err <> 0 Then Drive1.Drive = Dir1.Path
  142. End Sub
  143. Private Sub Form_Load()
  144. Dir1.Path = App.Path
  145. Drive1.Drive = App.Path
  146. Text1.Text = Dir1.Path
  147. End Sub