📄 form10.frm
字号:
VERSION 5.00
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "Command.ocx"
Begin VB.Form Form10
BackColor = &H00FFFFFF&
Caption = "更换数据库文件"
ClientHeight = 4380
ClientLeft = 60
ClientTop = 495
ClientWidth = 8415
LinkTopic = "Form10"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 4380
ScaleWidth = 8415
Begin CSCommand.Command Command2
Height = 495
Left = 6390
TabIndex = 8
Top = 1590
Width = 1755
_ExtentX = 3096
_ExtentY = 873
Icon = "Form10.frx":0000
Caption = "更换数据库 &C"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontColor = 12582912
End
Begin VB.Frame Frame3
BackColor = &H00FFFFFF&
Caption = "更换数据库文件"
ForeColor = &H00C00000&
Height = 720
Left = 210
TabIndex = 4
Top = 3435
Width = 8040
Begin CSCommand.Command Command1
Height = 360
Left = 6795
TabIndex = 7
Top = 225
Width = 1125
_ExtentX = 1984
_ExtentY = 635
IconAlign = 0
Icon = "Form10.frx":1992
Caption = "浏览 &S"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontColor = 12582912
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H00C00000&
Height = 240
Left = 210
Locked = -1 'True
TabIndex = 5
Top = 330
Width = 6435
End
Begin VB.Shape Shape1
BorderColor = &H00808080&
Height = 345
Left = 150
Shape = 4 'Rounded Rectangle
Top = 240
Width = 6570
End
End
Begin VB.Frame Frame2
BackColor = &H00FFFFFF&
Caption = "当前数据库"
ForeColor = &H00C00000&
Height = 945
Left = 210
TabIndex = 2
Top = 2295
Width = 8040
Begin VB.Label Label2
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
ForeColor = &H00800000&
Height = 180
Left = 300
TabIndex = 9
Top = 615
Width = 90
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
ForeColor = &H00800000&
Height = 180
Left = 300
TabIndex = 3
Top = 330
Width = 90
End
End
Begin VB.Frame Frame1
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 1950
Left = 195
TabIndex = 0
Top = 150
Width = 5355
Begin VB.Image Image1
Height = 1755
Left = 45
Picture = "Form10.frx":19AE
Top = 135
Width = 1800
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = $"Form10.frx":3344
ForeColor = &H000000FF&
Height = 1230
Left = 2145
TabIndex = 1
Top = 465
Width = 3075
End
End
Begin VB.Label Label5
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "我已经确定了更换数据库将要遇到的问题,并且我已经备份好数据库,但我确实想更换。"
ForeColor = &H00800000&
Height = 975
Left = 5745
TabIndex = 6
Top = 615
Width = 2505
WordWrap = -1 'True
End
End
Attribute VB_Name = "Form10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/12/24
'描 述:商务名片及客户资料管理系统 Ver 1.73
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Option Explicit
Private Sub Command1_Click()
Dim ofn As OPENFILENAME
Dim rtn As String
ofn.lStructSize = Len(ofn)
ofn.hwndOwner = Me.hwnd
ofn.hInstance = App.hInstance
ofn.lpstrFilter = "MDB数据库文件(*.mdb)" & Chr(0) & "*.MDB" & Chr(0)
ofn.lpstrFile = Space(254)
ofn.nMaxFile = 255
ofn.lpstrFileTitle = Space(254)
ofn.nMaxFileTitle = 255
ofn.lpstrInitialDir = App.Path
ofn.lpstrTitle = "打开文件"
ofn.flags = 6148
rtn = GetOpenFileName(ofn)
If rtn >= 1 Then
Text1.Text = ofn.lpstrFile
End If
End Sub
Private Sub Command2_Click()
If MsgBox("程序将更换数据库,此时终止的写入操作、为完成的读库操作将出现错误并可能导致程序意外终止。", vbQuestion + vbYesNo, "即将更换数据库") = vbYes Then
MdbPath = Text1.Text
MsgBox "当前数据库已经更换完毕。", vbInformation, "完毕"
Me.Label3.Caption = MdbPath
End If
SumNumber '求各个表中的记录数总和
If Dir(MdbPath) <> "" Then
Label2 = "当前数据库文件的大小:" & FileLen(MdbPath) / 1024
Label2 = Label2 & "( KB )"
If (FileLen(MdbPath) / 1024) > 999 Then
Label2 = "当前数据库文件的大小:" & FileLen(MdbPath) / 1024 / 1024
Label2 = Label2 & "( MB )"
End If
End If
Unload Me
End Sub
Private Sub Form_Load()
Me.Icon = MDIForm1.Icon
'Me.BackColor = FormBackColor
Me.Frame1.BackColor = Me.BackColor
Me.Frame2.BackColor = Me.BackColor
Me.Frame3.BackColor = Me.BackColor
Me.Height = 4890
Me.Width = 8535
form10show = True
Me.Label3.Caption = MdbPath
If Dir(MdbPath) <> "" Then
Label2 = "当前数据库文件的大小:" & FileLen(MdbPath) / 1024
Label2 = Label2 & "( KB )"
If (FileLen(MdbPath) / 1024) > 999 Then
Label2 = "当前数据库文件的大小:" & FileLen(MdbPath) / 1024 / 1024
Label2 = Label2 & "( MB )"
End If
End If
Command2.Enabled = False
End Sub
Private Sub Form_Resize()
On Error GoTo reerror
Me.Height = 4890
Me.Width = 8535
Exit Sub
reerror:
End Sub
Private Sub Form_Unload(Cancel As Integer)
form10show = False
End Sub
Private Sub Text1_Change()
If Len(Trim(Text1.Text)) >= 8 Then
Me.Command2.Enabled = True
Else
Command2.Enabled = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -