【VB开源代码栏目提醒】:网学会员,鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“frmDataBackup.frm”一文,供大家参考学习!
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmDataBackup
BorderStyle = 3 'Fixed Dialog
Caption = "备份数据"
ClientHeight = 4695
ClientLeft = 45
ClientTop = 330
ClientWidth = 7110
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4695
ScaleWidth = 7110
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin MSComctlLib.ImageList ImageList1
Left = 360
Top = 3990
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmDataBackup.frx":0000
Key = ""
EndProperty
EndProperty
End
Begin VB.Frame Frame2
Caption = "备份数据库信息"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2565
Left = 150
TabIndex = 3
Top = 1380
Width = 6795
Begin VB.CommandButton cmdDeleBackup
Caption = "删除备份"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 350
Left = 5400
TabIndex = 10
Top = 810
Width = 1200
End
Begin VB.CommandButton cmdRecover
Caption = "从备份恢复"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 350
Left = 5400
TabIndex = 9
Top = 1320
Width = 1200
End
Begin VB.CommandButton cmdBackupNew
Caption = "创建备份"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 350
Left = 5400
TabIndex = 5
Top = 300
Width = 1200
End
Begin MSComctlLib.ListView lvwBackData
Height = 2145
Left = 180
TabIndex = 4
Top = 240
Width = 5085
_ExtentX = 8969
_ExtentY = 3784
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
End
Begin VB.Frame Frame1
Caption = "当前数据库信息"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1185
Left = 150
TabIndex = 1
Top = 90
Width = 6795
Begin VB.Label lblFileSize
Alignment = 2 'Center
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Height = 315
Left = 1770
TabIndex = 8
Top = 690
Width = 1785
End
Begin
VB.Label lblSize
Caption = "数据库文件大小"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Left = 300
TabIndex = 7
Top = 750
Width = 1275
End
Begin VB.Label lblCount
Alignment = 2 'Center
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Height = 315
Left = 1770
TabIndex = 6
Top = 270
Width = 1785
End
Begin VB.Label lblInfo
Caption = "数据库纪录数量"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Left = 300
TabIndex = 2
Top = 360
Width = 1455
End
End
Begin VB.CommandButton cmdSure
Caption = " 确定(&S)"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 350
Left = 5550
TabIndex = 0
Top = 4140
Width = 1350
End
End
Attribute VB_Name = "frmDataBackup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdBackupNew_Click()
Dim fDataBackAdd As frmDataBackAdd
Set fDataBackAdd = New frmDataBackAdd
fDataBackAdd.Show vbModal
Call RefreshlvwBackData
End Sub
Private Sub cmdSure_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim FileSize As Long
Dim rstImage As ADODB.Recordset
On Error Resume Next
'取得纪录数量
Set rstImage = New ADODB.Recordset
rstImage.Open "SELECT COUNT(*) AS RecCount FROM sys_Image", conCaseMain, adOpenStatic, adLockOpti
mistic, adCmdText
lblCount.Caption = rstImage!RecCount
rstImage.Close
'取得数据库文件大小
FileSize = FileLen(App.Path & "\CaseMain.mdb")
If FileSize > 1024 ^ 2 Then
lblFileSize.Caption = FileSize / (1024 ^ 2) & " M"
Else
lblFileSize.Caption = FileSize / 1024 & " K"
End If
'初始化lvwBackData(备份文件)
With lvwBackData