【正文】
l Else Set rst = New Trim$(SQL), n, adOpenKeyset, adLockOptimistic Set ExecuteSQL = rst MsgString = 查詢到 amp。 條記錄 End IfExecuteSQL_Exit: Set rst = Nothing Set n = Nothing Exit FunctionExecuteSQL_Error: MsgString = 查詢錯誤: amp。在工程中添加一個窗體,命名為“frmMain”。菜單項的屬性如下:標(biāo)題 名稱用戶信息管理cusiMenu班級信息管理claiMenu學(xué)籍信息管理stsiMenu課程信息管理couiMenu成績信息管理scoiMenu獎懲信息管理prpiMenu個人信息管理sumiMenu幫助help主界面如下圖所示::Private Sub claiMenu_Click() End SubPrivate Sub couiMenu_Click() End SubPrivate Sub cusiMenu_Click() End SubPrivate Sub MDIForm_Load() End SubPrivate Sub MDIForm_Resize() If 1100 Then = 1100 End If If 180 Then = 180 End IfEnd SubPrivate Sub prpiMenu_Click() End SubPrivate Sub scoiMenu_Click() End SubPrivate Sub stsiMenu_Click() End SubPrivate Sub sumiMenu_Click() End Sub、登錄窗體的設(shè)計,命名為“frmLogin”。用戶要使用本系統(tǒng),首先要通過系統(tǒng)的身份認(rèn)證,即需要登錄。登錄界面窗體的主要屬性如下。 amp。 39。整個窗體的界面設(shè)計示意圖如下. dColor窗體上的空間及其屬性如下表所示。H8000000E = 12 = True i = End SubPrivate Sub Form_Resize() = 0 = 0 = = = = = 100End SubPrivate Sub Label1_Click()End SubPrivate Sub Timer1_Timer() i = i + 50 = i If i + Then i = End IfEnd Sub,命名為“frmclai”。frmclai窗體上的的主要屬性和控件設(shè)置如下: 對象名屬性屬性值 FrmclaiCaption班級信息MinbuttonTrueLinkTopicForm1HacDCTrueMSFlexGrid1DragMode0 – vbManualLabel1Caption班級信息列表Label2(0)Caption添加Label2(1)Caption修改Label2(2)Caption刪除Label3(0)Caption班級編號Label3(1)Caption班級名稱Label3(2)Caption導(dǎo)員姓名Label3(3)Caption備注Private Sub Command1_Click() If Text1(0) = Then MsgBox 班級編號不能為空!, vbOKOnly, 提示 Text1(0).SetFocus Exit Sub End If If Text1(1) = Then MsgBox 班級名稱不能為空!, vbOKOnly, 提示 Text1(1).SetFocus Exit Sub End If If Text1(2) = Then MsgBox 導(dǎo)員姓名不能為空!, vbOKOnly, 提示 Text1(2).SetFocus Exit Sub End If txtSQL = select * from class_Form where class_NO=39。 Trim(Text1(0)) amp。 Set mrc = ExecuteSQL(txtSQL, MsgText) If = False Then MsgBox 此班級編號已經(jīng)存在!, vbOKOnly, 警告 Text1(0).SetFocus Exit Sub End If txtSQL = select * from class_Form Set mrc = ExecuteSQL(txtSQL, MsgText) (0) = Trim(Text1(0)) (1) = Trim(Text1(1)) (2) = Trim(Text1(2)) (3) = Trim(Text1(3)) For i = 0 To 3 Text1(i) = Next MsgBox 班級信息添加成功!, vbOKOnly, 提示 ShowDataEnd SubPrivate Sub Command2_Click() For i = 0 To 3 Text1(i) = NextEnd SubPrivate Sub Command5_Click() txtSQL = delete from class_Form where class_NO=39。 Trim(Text1(8)) amp。 Set mrc = ExecuteSQL(txtSQL, MsgText) For i = 8 To 11 Text1(i) = Next MsgBox 班級已經(jīng)刪除!, vbOKOnly, 警告 ShowDataEnd SubPrivate Sub Command6_Click() For i = 8 To 11 Text1(i) = NextEnd SubPrivate Sub Form_Load() = 班級信息—添 加 Picture1(1).Top = Picture1(0).Top Picture1(1).Left = Picture1(0).Left Picture1(2).Top = Picture1(0).Top Picture1(2).Left = Picture1(0).Left ShowData For i = 0 To 2 Label2(i).BackColor = amp。HFFFFFF Picture1(0).Visible = TrueEnd SubPrivate Sub Form_Resize() 1End SubPrivate Sub Label2_Click(Index As Integer) = 班級信息 = amp。 Trim(Label2(Index).Caption) For i = 0 To 2 Label2(i).BackColor = amp。HFFFFFF Picture1(Index).Visible = True For i = 0 To 11 Text1(i) = Next = False = FalseEnd SubPrivate Sub ShowData() Dim txSQL As String Dim mrcc As txSQL = select * from class_Form Set mrcc = ExecuteSQL(txSQL, MsgText) With MSFlexGrid1 .ColWidth(0) = 1200 .ColWidth(1) = 1200 .ColWidth(2) = 1200 .ColWidth(3) = 6000 .TextMatrix(0, 0) = 班級編號 .TextMatrix(0, 1) = 班級名稱 .TextMatrix(0, 2) = 導(dǎo)員姓名 .TextMatrix(0, 3) = 備注信息162。 Next i Loop End With End SubPrivate Sub MSFlexGrid1_Click() If Picture1(1).Visible = True Then Text1(4) = Trim((, 0)) Text1(5) = Trim((, 1)) Text1(6) = Trim((, 2)) Text1(7) = Trim((, 3)) = True End If If Picture1(2).Visible = True Then Text1(8) = Trim((, 0)) Text1(9) = Trim((, 1)) Text1(10) = Trim((, 2)) Text1(11) = Trim((, 3)) = True End IfEnd SubPrivate Sub Text1_Change(Index As Integer) If Index = 4 Then tSQL = select * from class_Form where class_NO=39。 Trim(Text1(Index)) amp。 Set mrc = ExecuteSQL(tSQL, MsgText) If = False Then Text1(5) = (1) Text1(6) = (2) Text1(7) = (3) = True Exit Sub Else Text1(5) = Text1(6) = Text1(7) = = False End If End If If Index = 8 Then tSQL = select * from class_Form where class_NO=39。 Trim(Text1(Index)) amp。 Set mrc = ExecuteSQL(tSQL, MsgText) If = False Then Text1(9) = (1) Text1(10) = (2) Text1(11) = (3) = True Exit Sub Else Text1(9) = Text1(10) = Text1(11) = = False End If End IfEnd SubPrivate Sub Text1_GotFocus(Index As Integer) Text1(Index).SelStart = 0 Text1(Index).SelLength = Len(Text1(Index))End SubPrivate Sub Text1_KeyDown(Index As Int