📄 form_manage.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form Form_Manage
Caption = "数据字典管理"
ClientHeight = 7740
ClientLeft = 1500
ClientTop = 1590
ClientWidth = 10755
Icon = "Form_Manage.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 7740
ScaleWidth = 10755
Begin MSComDlg.CommonDialog FileDialog
Left = 3840
Top = 3960
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin MSComctlLib.ImageList Image_ToolBar
Left = 3720
Top = 4680
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 9
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":030A
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":07CD
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":0CEA
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":1249
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":17E2
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":1C36
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":2434
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":25EB
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":2B77
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList Img_Tree
Left = 3720
Top = 5280
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 3
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":2F74
Key = "close"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":3007
Key = "open"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":3549
Key = "file"
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList Image_List
Left = 3720
Top = 5880
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":399B
Key = "direct"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form_Manage.frx":3DED
Key = "file"
EndProperty
EndProperty
End
Begin MSComctlLib.ListView List_Main
Height = 6495
Left = 4320
TabIndex = 1
Top = 1080
Width = 5895
_ExtentX = 10398
_ExtentY = 11456
Arrange = 1
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
Icons = "Image_List"
SmallIcons = "Image_List1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin MSComctlLib.TreeView Tree_Main
Height = 6495
Left = 720
TabIndex = 0
Top = 1080
Width = 2775
_ExtentX = 4895
_ExtentY = 11456
_Version = 393217
Style = 7
Appearance = 1
End
Begin MSComctlLib.Toolbar Toolbar_Top
Align = 1 'Align Top
Height = 660
Left = 0
TabIndex = 4
Top = 0
Width = 10755
_ExtentX = 18971
_ExtentY = 1164
ButtonWidth = 1032
ButtonHeight = 1005
Appearance = 1
ImageList = "Image_ToolBar"
DisabledImageList= "Image_ToolBar"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 9
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "数据库设置"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "可执行文件设置"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "新建"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "导入"
ImageIndex = 4
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "打开"
ImageIndex = 5
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "删除"
ImageIndex = 6
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "查询"
ImageIndex = 7
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "连接文件服务器"
ImageIndex = 9
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "系统退出"
ImageIndex = 8
EndProperty
EndProperty
End
Begin VB.Label Label1
Caption = "列表框"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 255
Index = 1
Left = 4320
TabIndex = 3
Top = 720
Width = 975
End
Begin VB.Label Label1
Caption = "浏览框"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 255
Index = 0
Left = 600
TabIndex = 2
Top = 720
Width = 975
End
Begin VB.Menu mfile
Caption = "系统"
Begin VB.Menu mDB
Caption = "数据库设置"
End
Begin VB.Menu mExe
Caption = "可执行文件设置"
End
Begin VB.Menu mConect
Caption = "连接文件服务器"
End
Begin VB.Menu mExit
Caption = "退出"
End
End
Begin VB.Menu mmain
Caption = "操作"
Begin VB.Menu mNew
Caption = "新建"
End
Begin VB.Menu mInput
Caption = "导入"
End
Begin VB.Menu mopen
Caption = "打开"
End
Begin VB.Menu mDel
Caption = "删除"
End
End
Begin VB.Menu mQuery
Caption = "查询"
End
End
Attribute VB_Name = "Form_Manage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'******************************************************************
'函数名:NodeAdd()
'参数 :无
'功能 :添加树节点
'返回 :成功:true 失败:false
'******************************************************************
Public Function NodeAdd() As Boolean
Dim objRs As New ADODB.Recordset
Dim strSql As String
Dim intMax As Integer '节点层数
Dim IntIndex As Integer '节点序号
Dim i As Integer
On Error GoTo Err
'数据库连接
If Not CModule.IsConnect() Then
Err.Raise 90
End If
Tree_Main.LineStyle = tvwRootLines
Set Tree_Main.ImageList = Img_Tree
Dim mnode As Node
Set mnode = Tree_Main.Nodes.Add() ' 创建第一个节点。
mnode.Text = "字典平台"
mnode.Tag = "Direc"
mnode.Image = "close"
mnode.Key = "F1node"
'mnode.Index = 1
'取出节点层数
strSql = "select zdMax=max(len(zdtype)) from zdk "
objRs.Open strSql, CModule.objCon, adOpenDynamic, adLockBatchOptimistic, adCmdText
If IsNull(objRs("zdmax")) Then
intMax = 0
Else
intMax = CInt(objRs("zdmax"))
End If
objRs.Close
'添加每一层的子节点
For i = 1 To intMax
strSql = "select * from zdk where len(zdtype)=" & i & " order by ftype desc"
objRs.Open strSql, CModule.objCon, adOpenDynamic, adLockBatchOptimistic, adCmdText
While Not objRs.EOF
Set mnode = Tree_Main.Nodes.Add(Trim(objRs("zdtype")) & "node", tvwChild, _
Trim(objRs("zdtype")) & "C" & Trim(objRs("zdIndex")) & "node") ' 创建第i个节点。
mnode.Text = objRs("zdCode")
mnode.Tag = objRs("ftype")
If Trim(objRs("ftype")) = "Direc" Then
mnode.Image = "close"
Else
mnode.Image = "file"
End If
objRs.MoveNext
Wend
objRs.Close
Next
Call CModule.CloseRs(objRs)
NodeAdd = True
Exit Function
Err:
Select Case Err.Number
Case 90
MsgBox ("数据库连接失败,请从新设置数据库连接")
Case Else
MsgBox ("系统错误,错误描述:" & Err.Description & "错误位置:NodeAdd()")
End Select
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -