📄 -
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmDatabase
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "通用数据库管理程序"
ClientHeight = 4500
ClientLeft = 165
ClientTop = 855
ClientWidth = 7890
LinkTopic = "Form1"
ScaleHeight = 4500
ScaleWidth = 7890
StartUpPosition = 3 '窗口缺省
Begin VB.ListBox lstIndex
Appearance = 0 'Flat
Height = 2364
Left = 5040
TabIndex = 6
Top = 360
Width = 2175
End
Begin VB.ListBox lstField
Appearance = 0 'Flat
Height = 2364
Left = 2520
TabIndex = 3
Top = 360
Width = 2055
End
Begin VB.ListBox lstTDName
Appearance = 0 'Flat
Height = 2364
Left = 240
TabIndex = 0
Top = 360
Width = 1815
End
Begin MSComDlg.CommonDialog dlgFileName
Left = 7320
Top = 2280
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Line Line1
X1 = 0
X2 = 7920
Y1 = 3360
Y2 = 3360
End
Begin VB.Label lblNotice
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 375
Left = 0
TabIndex = 7
Top = 4080
Width = 7815
End
Begin VB.Label lblIndex
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 255
Left = 5040
TabIndex = 5
Top = 120
Width = 2175
End
Begin VB.Label lblField
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 255
Left = 2520
TabIndex = 4
Top = 120
Width = 2175
End
Begin VB.Label lblPoint
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 495
Left = 0
TabIndex = 2
Top = 3480
Width = 7815
End
Begin VB.Label lblTDName
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "请选择数据表:"
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 1
Top = 120
Width = 1815
End
Begin VB.Menu mnuDatabase
Caption = "数据库"
Begin VB.Menu mnuCreateDatabase
Caption = "创建"
End
Begin VB.Menu mnuOpenDatabase
Caption = "打开"
End
Begin VB.Menu mnuSep1
Caption = "-"
End
Begin VB.Menu mnuCompactDatabase
Caption = "压缩"
End
Begin VB.Menu mnuRepairDatabase
Caption = "修补"
End
Begin VB.Menu mnuSep2
Caption = "-"
End
Begin VB.Menu mnuFileArray
Caption = "近期打开文件"
Index = 0
End
Begin VB.Menu mnuSeparator
Caption = "-"
End
Begin VB.Menu mnuCloseDatabase
Caption = "关闭"
End
End
Begin VB.Menu mnuTable
Caption = "数据表"
Begin VB.Menu mnuCreateTable
Caption = "新建"
End
Begin VB.Menu mnuOpenTable
Caption = "打开"
End
Begin VB.Menu mnuDeleteTable
Caption = "删除"
End
End
Begin VB.Menu mnuField
Caption = "字段"
End
Begin VB.Menu mnuIndex
Caption = "索引"
End
Begin VB.Menu mnuRelation
Caption = "强制关联"
End
Begin VB.Menu mnuRecordset
Caption = "记录集"
Begin VB.Menu mnuAddDel
Caption = "添加或删除记录"
End
Begin VB.Menu mnuEdit
Caption = "编辑"
End
Begin VB.Menu mnuDisplay
Caption = "显示"
End
End
Begin VB.Menu mnuQuery
Caption = "查询"
End
Begin VB.Menu mnuBaseFileChange
Caption = "数据库和数据文件"
Begin VB.Menu mnuBaseToFile
Caption = "从数据库到数据文件"
End
Begin VB.Menu mnuFileToBase
Caption = "从数据文件到数据库"
End
End
Begin VB.Menu mnuSystem
Caption = "系统信息"
Begin VB.Menu mnuDrive
Caption = "驱动器"
End
Begin VB.Menu mnuDir
Caption = "目录"
End
Begin VB.Menu mnuFile
Caption = "文件"
End
End
Begin VB.Menu mnuEnd
Caption = "结束"
End
Begin VB.Menu puDataFile
Caption = "数据文件"
Visible = 0 'False
Begin VB.Menu puTableToFile
Caption = "由数据库变换为数据文件"
End
Begin VB.Menu puFileToTable
Caption = "由数据文件变换为数据库"
End
End
End
Attribute VB_Name = "frmDatabase"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'窗体frmDatabase
'起控制作用
'包括取得数据库名、数据表名、压缩数据库、修理数据库等功能
'启动对象
Option Explicit
Dim msgResult As VbMsgBoxResult '保存信息框选择结果
'--------------------------------------------------------
'“近期访问文件菜单”的声明部分
Dim intI As Integer, intRecent As Integer
Dim strKey As String, strINI As String
Dim strINIFileName As String
Dim strFileArray() As String
Dim mnuA As Menu, intMenuNum As Integer
Private Sub Form_Initialize()
mnuTable.Enabled = False '“数据表”菜单项无效
mnuField.Enabled = False '“字段”菜单项无效
mnuIndex.Enabled = False '“索引”菜单项无效
mnuRelation.Enabled = False '“强制关联”菜单项无效
mnuRecordset.Enabled = False '“记录集”菜单项无效
mnuQuery.Enabled = False '“查询”菜单项无效
End Sub
Private Sub Form_Load()
lblNotice.Visible = False '隐藏提示信息
lblTDName.Visible = False '隐藏文件名指示标签
lstTDName.Visible = False '隐藏文件名列表框
lblField.Visible = False '隐藏字段名指示标签
lstField.Visible = False '隐藏字段名列表框
lblIndex.Visible = False '隐藏索引名标签
lstIndex.Visible = False '隐藏索引名列表框
Line1.Visible = False '隐藏分割线
'----------------“近期访问文件菜单”加载窗体部分----------------------------
mnuFileArray(0).Visible = False '使标题为“菜单列表”的菜单不可视
mnuSep2.Visible = False '使分割线不可视
'读INI文件的有关内容到菜单数组
ReadFromINI Me
End Sub
'单击列表框事件
Private Sub lstTDName_Click()
mnuTable.Enabled = True '“数据表”菜单项有效
End Sub
'++++++++++++++++以下为函数或过程++++++++++++++++++++++
'过程功能:使用公共对话框取得数据库名字
Sub GetDBName(blnNew As Boolean)
Dim strOpenFileName As String
On Error GoTo DBNameError
With dlgFileName
.DialogTitle = "提供数据库名"
.DefaultExt = "mdb" '以.mdb为扩展名,缺省
.Filter = "(*.mdb)|*.mdb"
.CancelError = True '按"取消"则作为错误
If blnNew Then
.ShowSave '新建数据库
Else
.ShowOpen '打开已有的数据库
End If
If Err <> cdlCancel Then
strOpenFileName = .FileName '取得近期打开文件名
strDBName = .FileName '数据库全名
End If
End With
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -