【正文】
年級(jí) ,班級(jí) from class order by 年級(jí) ,班級(jí) Set mrc1 = ExecuteSQL(str) Do Until Set nodex = (, , a, (0), 1, 1) Do While Not If (0) = (0) Then Set nodex = (a, tvwChild, , (1), 2, 2) End If Loop a = a amp。建立 Treeview 和 MSFlexGrid 的聯(lián)系 Private Sub TreeView1_DblClick() On Error GoTo ss If = 0 Then Exit Sub End If txtsql = () txtsql = select * from class where 年級(jí) =39。 Trim(txtsql) amp。 or 班級(jí) =39。 Trim(txtsql) amp。 order by 年級(jí) ,班級(jí) printstr = txtsql = 瀏覽班級(jí) Exit Sub ss: End Sub 3. 6 課程管理 基本課程設(shè)置窗體代碼如下 Public Sub kechengshowtitle() Dim i As Integer With MSF1 .Cols = 3 .TextMatrix(0, 1) = 課程名稱 .TextMatrix(0, 2) = 教材 .ColWidth(0) = 0 .ColWidth(1) = 1000 .ColWidth(2) = 2021 .FixedRows = 1 .FillStyle = flexFillSingle .Col = 0 .Row = 0 .RowSel = 1 .ColSel = .Cols 1 .CellAlignment = 4 .Row = 1 End With End Sub Private Sub Command1_Click() Unload Me End Sub Private Sub Command2_Click() qxstr = Executeqx(4) If qxstr = readonly Then ss = MsgBox(對(duì)不起,你是只讀用戶不能添加記錄,請(qǐng)與管理員聯(lián)系! , vbInformation + vbOKOnly, 警告 ) Exit Sub End If If = 確定 Then If = Then sssss = MsgBox(課程名稱不能為空! , vbOKOnly + vbExclamation, 警告 ) Exit Sub End If If = Then sssss = MsgBox(教材不能為空! , vbOKOnly + vbExclamation, 警告 ) Exit Sub End If = select * from allkecheng where 課程名稱 =39。 Trim() amp。 If = False Then sssss = MsgBox(已經(jīng)存在該課程名稱! , vbOKOnly + vbExclamation, 警告 ) = 0 = Len() Exit Sub Else (0) = (1) = = 增加 = True = True = = = False = False kechengshowtitle kechengshowdata End If Else = True = True = = kechengshowtitle kechengshowdata = 確定 = False = False End If End Sub Private Sub Command3_Click() qxstr = Executeqx(4) If qxstr = readonly Then ss = MsgBox(對(duì)不起,你是只讀用戶不能添加記錄,請(qǐng)與管理員聯(lián)系! , vbInformation + vbOKOnly, 警告 ) Exit Sub End If If Trim((, 1)) = Then sssss = MsgBox(你還沒有選擇記錄! , vbOKOnly + vbExclamation, 警告) Else If MsgBox( 確 定 要 刪 除 課 程 名 稱 為 amp。 的記錄嗎? , vbOKCancel + vbExclamation, 警告 ) = vbOK Then = select * from allkecheng where 課程名稱 =39。 Trim((, 1)) amp。 = = kechengshowtitle kechengshowdata End If End If End Sub Private Sub Command4_Click() qxstr = Executeqx(4) If qxstr = readonly Then ss = MsgBox(對(duì)不起,你是只讀用戶不能修改記錄,請(qǐng)與管理員聯(lián)系! , vbInformation + vbOKOnly, 警告 ) Exit Sub End If If Trim((, 1)) = Then sssss = MsgBox(你還沒有選擇記錄! , vbOKOnly + vbExclamation, 警告) Else If = 確定 Then If = Then sssss = MsgBox(課程名稱不能為空! , vbOKOnly + vbExclamation, 警告 ) Exit Sub End If If = Then sssss = MsgBox(教材不能為空! , vbOKOnly + vbExclamation, 警告 ) Exit Sub End If = select * from allkecheng where 課程名稱 =39。 Trim((, 1)) amp。 (0) = (1) = = = kechengshowtitle kechengshowdata = 修改 = True = True = False = False Else = True = True = 確定 = False = False End If End If End Sub Private Sub Form_Load() = connstring kechengshowtitle kechengshowdata End Sub Public Sub kechengshowdata() Dim j As Integer Dim i As Integer Dim mrc As = select * from allkecheng order by 課程名稱 If = False Then With MSF1 .Rows = 15 .Row = 2 Do While Not .Rows = .Rows + 1 For i = 1 To .TextMatrix(.Row 1, i) = (i 1) Next i .Row = .Row + 1 Loop End With End If End Sub Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single) End Sub Private Sub MSF1_Click() If Trim((, 1)) = Then = = Else = select * from allkecheng where 課程名稱 =39。 Trim((, 1)) amp。 = (0) = (1) End If End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then End If End Sub 班級(jí)課程設(shè)置代碼如下 Private Sub MSF1_Click() End Sub Private Sub Combo1_Click(Index As Integer) Dim mrc As If Index = 0 Then txtsql = select DISTINCT 專業(yè) from class where 年級(jí) =39。 Trim(Combo1(0).Text) amp。 Set mrc = ExecuteSQL(txtsql) If = True Then Combo1(1).Text = Combo1(2).Text = Exit Sub End If Combo1(1).Clear Do Until Combo1(1).AddItem (0) Loop Combo1(1).ListIndex = 0 txtsql = select DISTINCT 年制 from class where 年級(jí) =39。 Trim(Combo1(0).Text) amp。 and 專業(yè) =39。 Trim(Combo1(1).Text) amp。 Set mrc = ExecuteSQL(txtsql) If = True Then Combo1(2).Text = Exit Sub End If Combo1(2).Clear Do Until Combo1(2).AddItem (0) Loop Combo1(2).ListIndex = 0 ElseIf Index = 1 Then txtsql = select DISTINCT 年制 from class where 年級(jí) =39。 Trim(Combo1(0).Text) amp。 and 專業(yè) =39。 Trim(Combo1(1).Text) amp。 Set mrc = ExecuteSQL(txtsql) If = True Then Combo1(0).Text = Combo1(2).Text = Exit Sub End If Combo1(2).Clear Do Until Combo1(2).AddItem (0) Loop Com