【正文】
ecuteSQL(txtsql) If = False Then MsgBox 已存在該用戶! , vbExclamation + vbOKOnly, 警告 Text1(0).SetFocus Text1(0).SelStart = 0 Text1(0).SelLength = Len(Text1(0).Text) Exit Sub End If txtsql = select * from userinfo Set mrc = ExecuteSQL(txtsql) (0) = Trim(Text1(0).Text) (1) = Trim(Text1(1).Text) For i = 0 To 2 If Option1(i).Value = True Then Select Case i Case 0 (admin) = y Case 1 (readonly) = y Case 2 For j = 0 To 2 If Check1(j).Value = 1 Then Select Case j Case 0 (qx1) = y Case 1 (qx2) = y Case 2 (qx3) = y End Select End If Next j End Select End If Next i MsgBox 用戶添加成功! , vbExclamation + vbOKOnly, 警告 Text1(0).Text = Text1(1).Text = Text1(2).Text = End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() Option1(2).Value = True End Sub Private Sub Form_Resize() Text1(0).SetFocus End Sub Private Sub Option1_Click(Index As Integer) If Index 2 Then For i = 0 To 2 Check1(i).Enabled = False Next i Else For i = 0 To 2 Check1(i).Enabled = True Next i End If End Sub 3. 4 學生檔案管理 檔案添加窗體的主要功能是錄入學生的基本檔案。 Trim(Text1(0).Text) amp。代碼如下 Private Sub Command1_Click() If Trim(Text1(0).Text) = Then MsgBox 用戶名不能為空! , vbExclamation + vbOKOnly, 警告 Text1(0).SetFocus Exit Sub End If If Trim(Text1(1).Text) = Then MsgBox 密碼不能為空! , vbExclamation + vbOKOnly, 警告 Text1(1).SetFocus Exit Sub End If If Trim(Text1(2).Text) = Then MsgBox 確認密碼不能為空! , vbExclamation + vbOKOnly, 警告 Text1(2).SetFocus Exit Sub End If If Trim(Text1(1).Text) Trim(Text1(2).Text) Then MsgBox 確認密碼不正確! , vbExclamation + vbOKOnly, 警告 Text1(2).SetFocus Exit Sub End If Dim aa As Integer aa = 0 If Option1(2).Value = True Then For i = 0 To 3 If Check1(i).Value = 1 Then aa = 1 Exit For End If Next i If aa = 0 Then MsgBox 普通用戶至少要有一項權限! , vbExclamation + vbOKOnly, 警告 Exit Sub End If End If Dim mrc As txtsql = select * from userinfo where username=39。 Set mrc = ExecuteSQL(txtsql) If = True Then MsgBox 密碼錯誤! , vbExclamation + vbOKOnly, 警告 = 0 = Len() Exit Sub End If Unload Me End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then End If End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then End If End Sub 3. 3 系統(tǒng)管理 這個模塊的功能主要是添加用戶。 Trim() amp。 Set mrc = ExecuteSQL(txtsql) If = True Then MsgBox 用戶名錯誤! , vbExclamation + vbOKOnly, 警告 = 0 = Len() Exit Sub End If username = (0) txtsql = select username from userinfo where password=39。 Trim() amp。代碼如下 Private Sub Command1_Click() Dim mrc As txtsql = select username from userinfo where username=39。以及確定權限。 End Select On Error GoTo exectuesql_error Set rst = New Trim(sql), mycon, adOpenKeyset, adLockOptimistic If (0) = y Then Executeqx = true Else Executeqx = false End If exectuesql_exit: Set rst = Nothing Set mycon = Nothing Exit Function exectuesql_error: Resume exectuesql_exit End Function 3. 2 登陸系統(tǒng) 這個模塊主要有確定跟取消組成。 username amp。 Case 3 sql = select qx3 from userinfo where username=39。 username amp。 Case 2 sql = select qx2 from userinfo where username=39。 username amp。 Trim(sql), mycon, adOpenKeyset, adLockOptimistic If (0) = y Then Executeqx = readonly Exit Function End If Select Case txt Case 1 sql = select qx1 from userinfo where username=39。 username amp。 Trim(sql), mycon, adOpenKeyset, adLockOptimistic If = True Then MsgBox 非法用戶! , vbExclamation + vbOKOnly, 警告 Executeqx = nothing Exit Function End If If (0) = y Then Executeqx = admin Exit Function End If sql = select readonly from userinfo where username=39。 username amp。檢查用戶的權限 Public Function Executeqx(ByVal txt As Integer) As String Dim sql As String Dim mycon As Dim rst As Set mycon = New = connstring Set rst = New sql = select admin from userinfo where username=39。Initial Catalog=StudentMIS。UID=sa。連接字符串,用戶可以根據(jù)自己的數(shù)據(jù)庫進行修改相應參數(shù) Public Function connstring() As String connstring = Provider=。 代碼如下: Public modi As Boolean Public classmodi As Boolean Public xuefeimodi As Boolean Public txtsql As String Public find As Boolean Public classfind As Boolean Public xuefeifind As Boolean Public username As String Public qxstr As String 39。 成 績 瀏覽 一個完成的學生管理系統(tǒng),自然要提供學生的查詢,方便學生和老師 2. 5 數(shù)據(jù)庫設計 2. 5. 1 數(shù)據(jù)庫表的建立 系統(tǒng)數(shù)據(jù)庫名稱為 StudengMIS。 也可以作為對學生評價的準則之一。方便學校同學老師查成績。 考試 類型設置 不同的功課自然有不同的成績。 學生檔案管理系統(tǒng) 系統(tǒng)管理 學生檔案管理 班級管理 課程管理 成績管理 班級瀏覽菜單 可以方便學校統(tǒng)一瀏覽班級的信息 課程 管理 菜單:包括 基本課程設置 , 基本課程設置 可以對課程的信息進行修改增加 班級課程設置 可以選擇班級相應的課程。這個菜單的功能最大的優(yōu)點就是方便。這個菜單恰好提供這個功能, 檔案瀏覽 當我們將學生的學籍信息存放在數(shù)據(jù)庫中,最大的方便就是我們有需要知道學生的學籍信息時能夠及時查詢到。 檔案添加 正如一個添加用戶一樣。所有設計了這個功能是理所當然的。方便登陸的用戶進行一系列的操作,提供了方便。 對于這個主頁面。分別為??紤]到數(shù)據(jù)的安全性,用戶必須擁有密碼才能夠登陸到本系統(tǒng) 的主頁 面 。我們把系統(tǒng)功能分為如下圖。在各大中小學校中,用計算機管理學校的信息已經(jīng)越來有越普遍了。 據(jù)項、數(shù)據(jù)流、數(shù)據(jù)存儲、加工處理和數(shù)據(jù)結構的數(shù)據(jù)字典。這就需要開發(fā)人員編寫詳細的數(shù)據(jù)字典 。 學生檔案管理系統(tǒng)的數(shù)據(jù)流程圖如圖 2- 5 所示 外部實體 處理 數(shù)據(jù)流 數(shù)據(jù)