📄 frm类别表.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frm类别表
BorderStyle = 3 'Fixed Dialog
Caption = "类别表"
ClientHeight = 3750
ClientLeft = 3600
ClientTop = 2640
ClientWidth = 6165
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3750
ScaleWidth = 6165
Begin TabDlg.SSTab SSTab1
Height = 3540
Left = 75
TabIndex = 0
Top = 75
Width = 6015
_ExtentX = 10610
_ExtentY = 6244
_Version = 393216
Style = 1
Tabs = 2
TabsPerRow = 2
TabHeight = 520
TabCaption(0) = "输入类别"
TabPicture(0) = "frm类别表.frx":0000
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "lblLabels(2)"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "lblLabels(1)"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "lblLabels(0)"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "datPrimaryRS"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).Control(4)= "picButtons"
Tab(0).Control(4).Enabled= 0 'False
Tab(0).Control(5)= "txtFields(2)"
Tab(0).Control(5).Enabled= 0 'False
Tab(0).Control(6)= "txtFields(1)"
Tab(0).Control(6).Enabled= 0 'False
Tab(0).Control(7)= "txtFields(0)"
Tab(0).Control(7).Enabled= 0 'False
Tab(0).Control(8)= "Data1"
Tab(0).Control(8).Enabled= 0 'False
Tab(0).ControlCount= 9
TabCaption(1) = "类别清单"
TabPicture(1) = "frm类别表.frx":001C
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "ListView1"
Tab(1).ControlCount= 1
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\MyProducts\Programs\Manager\Manager.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 4800
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "类别表"
Top = 2325
Visible = 0 'False
Width = 1140
End
Begin MSComctlLib.ListView ListView1
Height = 2865
Left = -74850
TabIndex = 13
Top = 525
Width = 5715
_ExtentX = 10081
_ExtentY = 5054
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin VB.TextBox txtFields
DataField = "类别编号"
DataSource = "datPrimaryRS"
Height = 285
Index = 0
Left = 2115
TabIndex = 9
Top = 450
Width = 3375
End
Begin VB.TextBox txtFields
DataField = "适合职位"
DataSource = "datPrimaryRS"
Height = 285
Index = 1
Left = 2115
TabIndex = 8
Top = 765
Width = 3375
End
Begin VB.TextBox txtFields
DataField = "文件类别"
DataSource = "datPrimaryRS"
Height = 285
Index = 2
Left = 2115
TabIndex = 7
Top = 1095
Width = 3375
End
Begin VB.PictureBox picButtons
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 300
Left = 75
ScaleHeight = 300
ScaleWidth = 5775
TabIndex = 1
Top = 2820
Width = 5775
Begin VB.CommandButton cmdAdd
Caption = "添加(&A)"
Height = 300
Left = 59
TabIndex = 6
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdUpdate
Caption = "更新(&U)"
Height = 300
Left = 1213
TabIndex = 5
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdDelete
Caption = "删除(&D)"
Height = 300
Left = 2367
TabIndex = 4
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdRefresh
Caption = "刷新(&R)"
Height = 300
Left = 3521
TabIndex = 3
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdClose
Caption = "关闭(&C)"
Height = 300
Left = 4675
TabIndex = 2
Top = 0
Width = 1095
End
End
Begin VB.Data datPrimaryRS
Connect = "Access"
DatabaseName = "D:\MyProducts\Programs\Manager\Manager.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 75
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "类别表"
Top = 3120
Width = 5775
End
Begin VB.Label lblLabels
Caption = "类别编号:"
Height = 255
Index = 0
Left = 195
TabIndex = 12
Top = 450
Width = 1815
End
Begin VB.Label lblLabels
Caption = "适合职位:"
Height = 255
Index = 1
Left = 195
TabIndex = 11
Top = 765
Width = 1815
End
Begin VB.Label lblLabels
Caption = "文件类别:"
Height = 255
Index = 2
Left = 195
TabIndex = 10
Top = 1095
Width = 1815
End
End
End
Attribute VB_Name = "frm类别表"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub datPrimaryRS_Error(DataErr As Integer, Response As Integer)
'错误处理程序代码置于此处
'想要忽略错误,注释掉下一行
'想要捕获它们,在此添加代码以处理它们
MsgBox "Data error event hit err:" & Description
End Sub
Private Sub datPrimaryRS_Validate(Action As Integer, Save As Integer)
'为这个 recordset 显示当前记录位置
datPrimaryRS.Caption = "Record: " & CStr(datPrimaryRS.Recordset.AbsolutePosition)
End Sub
Private Sub Form_Initialize()
FillList
End Sub
Function FillList()
Dim item As ListItem
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , "类别编号"
ListView1.ColumnHeaders.Add , , "适合职位"
ListView1.ColumnHeaders.Add , , "文件类别"
ListView1.ListItems.Clear
ListView1.View = lvwReport
Data1.RecordSource = "select * from 类别表"
Data1.Refresh
Do Until Data1.Recordset.EOF
Set item = ListView1.ListItems.Add(, , Data1.Recordset.Fields("类别编号").Value)
item.ListSubItems.Add , , Data1.Recordset.Fields("适合职位").Value
item.ListSubItems.Add , , Data1.Recordset.Fields("文件类别").Value
Data1.Recordset.MoveNext
Loop
Data1.Recordset.Close
End Function
Private Sub Form_Load()
Data1.DatabaseName = conn
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub
Private Sub cmdAdd_Click()
On Error GoTo AddErr
datPrimaryRS.Recordset.AddNew
Exit Sub
AddErr:
MsgBox Err.Description
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With datPrimaryRS.Recordset
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Private Sub cmdRefresh_Click()
'只有多用户应用程序需要
On Error GoTo RefreshErr
datPrimaryRS.Refresh
Exit Sub
RefreshErr:
MsgBox Err.Description
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo UpdateErr
datPrimaryRS.Recordset.MoveNext
datPrimaryRS.Recordset.MovePrevious
Exit Sub
UpdateErr:
MsgBox Err.Description
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub ListView1_ItemClick(ByVal item As MSComctlLib.ListItem)
datPrimaryRS.Recordset.Filter = "类别编号 = " & item.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -