【正文】
olean Dim mrc As txtSQL = select * from 院系信息表 where If Then If Trim() = Then sMeg = 院系名稱(chēng)不能為空 MsgBox sMeg, vbOKOnly + vbExclamation, 警告 Exit Sub Else dd(0) = True If dd(1) Then txtSQL = txtSQL amp。 and 院系名稱(chēng) = 39。 amp。 amp。 39。 Else txtSQL = txtSQL amp。 院系名稱(chēng) = 39。 amp。 amp。 39。 End If End If End If If Then If Trim() = Then sMeg = 院系編號(hào)不能為空 MsgBox sMeg, vbOKOnly + vbExclamation, 警告 Exit Sub Else If Not IsNumeric(Trim()) Then MsgBox 請(qǐng)輸入數(shù)字! , vbOKOnly + vbExclamation, 警告 Exit Sub 39 End If dd(1) = True txtSQL = txtSQL amp。 院系編號(hào) = amp。 Trim() 39。amp。 39。 End If End If If Not (dd(0) Or dd(1) Or dd(2)) Then MsgBox 請(qǐng)?jiān)O(shè)置查詢(xún)方式! , vbOKOnly + vbExclamation, 警告 Exit Sub End If txtSQL = txtSQL amp。 order by 院系名稱(chēng) Set mrc = ExecuteSQL(txtSQL, MsgText) With MSFlexGrid1 .Rows = 2 .CellAlignment = 1 .TextMatrix(1, 0) = 編號(hào) .TextMatrix(1, 1) = 院系名稱(chēng) .TextMatrix(1, 2) = 院系負(fù)責(zé)人 .TextMatrix(1, 3) = 院系編號(hào) .TextMatrix(1, 4) = 院系專(zhuān)業(yè) .TextMatrix(1, 5) = 院系電話 Do While Not .Rows = .Rows + 1 .CellAlignment = 4 .TextMatrix(.Rows 1, 0) = (0) .TextMatrix(.Rows 1, 1) = (1) .TextMatrix(.Rows 1, 2) = (2) .TextMatrix(.Rows 1, 3) = (3) .TextMatrix(.Rows 1, 4) = (4) .TextMatrix(.Rows 1, 5) = (5) Loop End With End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() With MSFlexGrid1 .CellAlignment = 4 .TextMatrix(1, 0) = 編號(hào) 40 .TextMatrix(1, 1) = 院系名稱(chēng) .TextMatrix(1, 2) = 院系負(fù)責(zé)人 .TextMatrix(1, 3) = 院系編號(hào) .TextMatrix(1, 4) = 院系專(zhuān)業(yè) .TextMatrix(1, 5) = 院系電話 End With End Sub 設(shè)置年級(jí)課程信息代碼如下: Private Sub Combo1_Change() Dim mrc As Dim txtSQL As String Dim MsgText As String Dim i As Integer 39。清除列表框內(nèi)容 txtSQL = select * form 年 級(jí) 課 程 設(shè) 置 表 where 院 系 名 稱(chēng)=39。 amp。 amp。 39。 Set mrc = ExecuteSQL(txtSQL, MsgText) End Sub Private Sub Combo2_Change() Dim mrc As Dim txtSQL As String Dim MsgText As String Dim i As Integer 39。清除列表框內(nèi)容 txtSQL = select * form 年 級(jí) 課 程 設(shè) 置 表 where 年級(jí)=39。 amp。 amp。 39。 Set mrc = ExecuteSQL(txtSQL, MsgText) End Sub Private Sub Command1_Click() If 1 Then () End If End Sub Private Sub Command2_Click() If 1 Then End If End Sub Private Sub Command3_Click() Dim mrc As Dim txtSQL As String Dim MsgText As String 39。使各個(gè)控件有效 = True = True 41 = True 39。查詢(xún)數(shù)據(jù) txtSQL = select * form 課程信息表 Set mrc = ExecuteSQL(txtSQL, MsgText) While ( = False) (1) Wend flagset = True End Sub Private Sub Command4_Click() Dim i As Integer Dim mrc As Dim mrcc As Dim txtSQL As String Dim MsgText As String Dim myBookmark As Variant If Not Testtxt() Then MsgBox 請(qǐng)先選擇院系名稱(chēng)! , vbOKOnly + vbExclamation, 警告 Exit Sub End If If Not Testtxt() Then MsgBox 請(qǐng)先選擇年級(jí) ! , vbOKOnly + vbExclamation, 警告 Exit Sub End If If Not Testtxt((0)) Then MsgBox 請(qǐng)先選擇課程 ! , vbOKOnly + vbExclamation, 警告 Exit Sub End If For i = 1 To txtSQL = select * from 年 級(jí) 課 程 設(shè) 置 表 where 年級(jí)=39。 amp。 Trim() amp。 39。and 39。 amp。 Trim() amp。 39。Set mrc = ExecuteSQL(txtSQL, MsgText) If = True And = True Then (院系名稱(chēng) ) = Trim() (年級(jí) ) = Trim() (課程名稱(chēng) ) = Trim((i 1)) End If 42 Next i = = End Sub Private Sub Command5_Click() Unload Me End Sub Private Sub Form_Load() Dim mrc As Dim txtSQL As String Dim MsgText As String txtSQL = select * from 班級(jí)信息表 Set mrc = ExecuteSQL(txtSQL, MsgText) While = False (年級(jí) ) Wend txtSQL = select * from 院系信息表 Set mrc = ExecuteSQL(txtSQL, MsgText) While = False (院系名稱(chēng) ) Wend txtSQL = select * from 課程信息表 Set mrc = ExecuteSQL(txtSQL, MsgText) While = False (課程名稱(chēng) ) Wend End Sub Private Sub List1_Click() If 1 Then = 1 End If End Sub Private Sub List2_Click() If 1 Then = 1 End If End Sub