【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-C课程查询.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmCourseQ
Caption = "课程查询"
ClientHeight = 4500
ClientLeft = 4080
ClientTop = 3945
ClientWidth = 8280
LinkTopic = "Form1"
ScaleHeight = 4500
ScaleWidth = 8280
Begin VB.CommandButton CmdExit
Caption = "退出"
Height = 435
Left = 7260
TabIndex = 6
Top = 3480
Width = 975
End
Begin VB.ComboBox CboQuery
Height = 300
Index = 2
Left = 1020
TabIndex = 5
Top = 3540
Width = 2295
End
Begin VB.ComboBox CboQuery
Height = 315
Index = 0
Left = 960
TabIndex = 4
Top = 2400
Width = 2295
End
Begin VB.ComboBox CboQuery
Height = 300
Index = 1
Left = 960
TabIndex = 3
Top = 2940
Width = 2295
End
Begin VB.CommandButton CmdQuery
Caption = "班级课程分配查询"
Height = 495
Index = 0
Left = 4860
TabIndex = 2
Top = 3480
Width = 1695
End
Begin VB.CommandButton CmdQuery
Caption = "系课程查询"
Height = 495
Index = 1
Left = 4860
TabIndex = 1
Top = 2640
Width = 1695
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 2295
Left = 0
TabIndex = 0
Top = 0
Width = 8055
_ExtentX = 14208
_ExtentY = 4048
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "课程分配信息"
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.Label Label1
Caption = "分配班级:"
Height = 255
Left = 60
TabIndex = 9
Top = 3540
Width = 975
End
Begin VB.Label Label8
Caption = ":"
Height = 255
Index = 0
Left = 240
TabIndex = 8
Top = 2520
Width = 735
End
Begin VB.Label Label9
Caption = "系:"
Height = 240
Left = 180
TabIndex = 7
Top = 3000
Width = 495
End
End
Attribute VB_Name = "frmCourseQ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim SQLStr As String
Dim msg As String
Private Sub SelectData(Index As Integer)
Dim rst As ADODB.Recordset
Dim strItem As String
'初始化系ComboBox
If Index = 0 Then '如果是选择院
SQLStr = " select departmentID,nameD from 系信息表 where collegeID='"
SQLStr = SQLStr & Left(Trim(CboQuery(0).Text), 2) & "' order by departmentID"
Set rst = SelectSQL(SQLStr, msg)
CboQuery(1).Clear
If rst.RecordCount > 0 Then
Do While Not rst.EOF
strItem = rst.Fields(0) & " " & rst.Fields(1)
CboQuery(1).AddItem (strItem)
rst.MoveNext
Loop
rst.Close
CboQuery(1).ListIndex = 0
Else
Exit Sub
End If
ElseIf Index = 1 Then '如果是选择系
SQLStr = " select classID,classname from 班级信息表 where departmentID='"
SQLStr = SQLStr & Left(Trim(CboQuery(1).Text), 4) & "' order by classID"
Set rst = SelectSQL(SQLStr, msg)
CboQuery(2).Clear
If rst.RecordCount > 0 Then
Do While Not rst.EOF
strItem = rst.Fields(0) & " " & rst.Fields(1)
CboQuery(2).AddItem (strItem)
rst.MoveNext
Loop
rst.Close
CboQuery(2).ListIndex = 0
Else
Exit Sub
End If
End If
End Sub
Private Sub CboQuery_Click(Index As Integer)
If Index = 0 Then
Call SelectData(0) '得到系列表
ElseIf Index = 1 Then
If CboQuery(1).ListCount > 0 Then
Call SelectData(1) '得到班级列表
End If
End If
End Sub
Private Sub CmdExit_Click()
'退出操作
Unload Me
frmMain.Enabled = True
End Sub
Private Sub CmdQuery_Click(Index As Integer)
Dim rst As ADODB.Recordset
Dim strClassNo As String
Dim majorNo As String
Dim divDate As String
If Index = 0 Then '查询班级分配课程
If CboQuery(2).ListCount > 0 Then '如存在班级
strClassNo = Left(Trim(CboQuery(2).Text), 6)
DataGrid1.Caption = strClassNo & "班课程分配信息"
SQLStr = "select * from 课程分配信息表 where classID='" & strClassNo & "' order by 分配ID"
Set rst = SelectSQL(SQLStr, msg)
Set DataGrid1.DataSource = rst
DataGrid1.Refresh
Else
DataGrid1.Caption = "无班级课程分配信息"
Exit Sub
End If
Else '查询系课程
If CboQuery(1).ListCount > 0 Then '如果存在系
majorNo = Left(Trim(CboQuery(1).Text), 4)
DataGrid1.Caption = majorNo & "系课程信息"
SQLStr = "select * from 课程信息表 where departmentID='" & majorNo & "' order by courseID"
Set rst = SelectSQL(SQLStr, msg)
Set DataGrid1.DataSource = rst
DataGrid1.Refresh
Else
DataGrid1.Caption = "无系课程信息"
Exit Sub
End If
End If
End Sub
Private Sub Form_Load()
Dim rst As ADODB.Recordset
Dim strItem As String
'初始化ComboBox
SQLStr = " select collegeID,nameC from 院信息表 order by collegeID"
Set rst = SelectSQL(SQLStr, msg)
If rst.RecordCount > 0 Then
Do While Not rst.EOF
strItem = rst.Fields(0) & " " & rst.Fields(1)
CboQuery(0).AddItem (strItem)
rst.MoveNext
Loop
rst.Close
CboQuery(0).ListIndex = 0
Else
MsgBox ("请先创建院信息!") '如果没有院信息不能使用
CboQuery(0).E
上一篇:
C课程分配.frm
下一篇:
浅析普外科围手术期抗菌药物的应用