《最新vb和SQL做的学生成绩管理系统.doc》由会员分享,可在线阅读,更多相关《最新vb和SQL做的学生成绩管理系统.doc(72页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-datevb和SQL做的学生成绩管理系统vb和SQL做的学生成绩管理系统Form1的代码:Private Sub Command1_Click()Unload MeForm3.ShowEnd SubPrivate Sub Command2_Click()Unload MeForm2.ShowEnd SubPrivate Sub Command3_Click()If MsgBo
2、x(确定退出管理系统?, _ vbQuestion + vbYesNo + vbDefaultButton2, 警告!) = vbYes ThenEndEnd IfEnd SubPrivate Sub Picture1_Click()End SubPrivate Sub Timer1_Timer()Command4.Caption = Time$() End SubPrivate Sub Form_Load()Timer1.Interval = 1000Timer1.Enabled = TrueEnd SubForm2的代码:Private Sub Command1_Click()Adodc1
3、.Recordset.MoveFirst Adodc1.Recordset.Find 用户名= & Text1.Text & If Adodc1.Recordset.EOF = True Then Adodc1.Recordset.MoveFirst If (Trim(Text1.Text) = (Trim(Text3.Text) And (Trim(Text2.Text) = (Trim(Text4.Text) Then Adodc1.Enabled = False Form4.Text3.Text = Text1.Text Unload Me Form8.Show Else MsgBox
4、非法的账号!, vbOKOnly + vbExclamation, 请重新输入! Text1.Text = Text2.Text = Text1.SetFocus End IfEnd SubPrivate Sub Command2_Click()Text1.Text = Text2.Text = End SubPrivate Sub Command3_Click()Unload MeForm1.ShowEnd SubPrivate Sub Form_Load()Text2.Text = Text1.Text = Text2.PasswordChar = *End SubPrivate Sub
5、Picture1_Click()End SubForm3的代码:Private Sub Command1_Click()Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 用户名= & Text1.Text & If Adodc1.Recordset.EOF = True Then Adodc1.Recordset.MoveFirst If (Trim(Text1.Text) = (Trim(Text3.Text) And (Trim(Text2.Text) = (Trim(Text4.Text) Then Adodc1.Enabled = Fal
6、se Form4.Text1.Text = Text1.Text Form4.Text2.Text = Text4.Text Unload Me Form5.Show Else MsgBox 非法的账号!, vbOKOnly + vbExclamation, 请重新输入! Text1.Text = Text2.Text = Text1.SetFocus End IfEnd SubPrivate Sub Command2_Click() Option1.Value = False Option2.Value = False Text1.Text = Text2.Text = End SubPri
7、vate Sub Command3_Click()Unload MeForm1.ShowEnd SubPrivate Sub Form_Load()Text2.Text = Text1.Text = Text2.PasswordChar = *End Sub无代码Form5的代码:Private Sub cjcx_Click(Index As Integer)Unload MeForm7.ShowEnd SubPrivate Sub Command1_Click()On Error Resume Next If Command1.Caption = 修改 Then Command1.Capti
8、on = 确认 Adodc2.Recordset.Requery Text5.SetFocus Else Command1.Caption = 修改 Adodc2.Recordset.Update MsgBox 修改成功 End IfEnd SubPrivate Sub Form_Load()Adodc1.CommandType = adCmdUnknownAdodc1.RecordSource = Select * From studentwel Where 用户名 = & Form4.Text1.Text & Adodc1.Refresh Text1.Visible = TrueText3
9、.Visible = TrueTimer1.Interval = 1000Timer1.Enabled = TrueEnd SubPrivate Sub Picture1_Click()End SubPrivate Sub tcxt_Click(Index As Integer)Unload MeForm3.ShowEnd SubPrivate Sub Timer1_Timer()Text2.Text = Time$() End SubPrivate Sub xgmm_Click()Label5.Visible = TrueLabel7.Visible = TrueText4.Visible
10、= TrueText5.Visible = TrueCommand1.Visible = TrueAdodc2.CommandType = adCmdUnknownAdodc2.RecordSource = Select * From studententer Where 用户名 = & Form4.Text1.Text & Adodc2.RefreshEnd SubPrivate Sub xxcx_Click(Index As Integer)Unload MeForm6.ShowEnd SubForm6的代码:Private Sub Command1_Click()Unload MeFor
11、m5.ShowEnd SubPrivate Sub Command2_Click()On Error Resume Next If Command2.Caption = 修改 Then Text1.SetFocus Command2.Caption = 确认 Adodc1.Recordset.Requery MsgBox 信息修改成功 Else Command2.Caption = 修改 Adodc1.Recordset.Update End If End SubPrivate Sub Form_Load()Adodc1.CommandType = adCmdUnknownAdodc1.Rec
12、ordSource = Select * From studentinfor Where 学号 = & Form4.Text1.Text & Adodc1.Refresh Text1.Visible = TrueText2.Visible = TrueText3.Visible = TrueText4.Visible = TrueText5.Visible = TrueText6.Visible = TrueText7.Visible = TrueText8.Visible = TrueEnd SubPrivate Sub Picture1_Click()End SubPrivate Sub
13、Command1_Click()Unload MeForm5.ShowEnd SubPrivate Sub Form_Load()Adodc1.Recordset.MoveFirst Dim a As String a = Form4.Text1.Text Adodc1.Recordset.Find 学号= & a & Text1.Visible = TrueText2.Visible = TrueText4.Visible = TrueText6.Visible = TrueDim b As Integerb = Text2.TextIf b = 90 ThenText3.Text = 优E
14、lseIf b = 80 ThenText3.Text = 良ElseIf b = 70 ThenText3.Text = 中ElseIf b = 60 ThenText3.Text = 及格ElseText3.Text = 不及格End IfDim c As Integerc = Text4.TextIf c = 90 ThenText5.Text = 优ElseIf c = 80 ThenText5.Text = 良ElseIf c = 70 ThenText5.Text = 中ElseIf c = 60 ThenText5.Text = 及格ElseText5.Text = 不及格End
15、 IfDim d As Integerd = Text6.TextIf d = 90 ThenText7.Text = 优ElseIf d = 80 ThenText7.Text = 良ElseIf d = 70 ThenText7.Text = 中ElseIf d = 60 ThenText7.Text = 及格ElseText7.Text = 不及格End IfIf Text3.Text = 不及格 ThenText2.ForeColor = &HFF&End IfIf Text5.Text = 不及格 ThenText4.ForeColor = &HFF&End IfIf Text7.T
16、ext = 不及格 ThenText6.ForeColor = &HFF&End IfEnd SubPrivate Sub Picture1_Click()End SubForm8的代码:Private Sub Command1_Click()On Error Resume Next If Command1.Caption = 修改 Then Command1.Caption = 确认 Adodc1.Recordset.Requery Text2.SetFocus Else Command1.Caption = 修改 Adodc1.Recordset.Update MsgBox 修改成功 En
17、d IfEnd SubPrivate Sub file1_Click()Unload MeForm10.ShowEnd SubPrivate Sub file2_Click()Unload MeForm9.ShowEnd SubPrivate Sub file4_Click()Unload MeForm12.ShowEnd SubPrivate Sub file5_Click()Unload MeForm11.ShowEnd SubPrivate Sub file7_Click()Unload MeForm2.ShowEnd SubPrivate Sub file8_Click()Label3
18、.Visible = TrueLabel4.Visible = TrueText1.Visible = TrueText2.Visible = TrueCommand1.Visible = TrueAdodc1.CommandType = adCmdUnknownAdodc1.RecordSource = Select * From teacherenter Where 用户名 = & Form4.Text3.Text & Adodc1.RefreshEnd SubPrivate Sub Picture1_Click()End SubForm9的代码:Private Sub Command1_
19、Click()Dim mno As String mno = InputBox(请输入学号, 查找窗) Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 学号= & mno & If Adodc1.Recordset.EOF = True Then MsgBox 无此学号!, , 提示End SubPrivate Sub Command2_Click()Unload MeForm8.ShowEnd SubPrivate Sub Command3_Click()Dim mnon As String mnon = InputBox(请输入姓名, 查找
20、窗) Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 姓名= & mnon & If Adodc1.Recordset.EOF = True Then MsgBox 无此学号!, , 提示End SubPrivate Sub Label5_Click()End SubPrivate Sub Label7_Click()End SubForm10的代码:Private Sub Command1_Click()On Error Resume Next Command2.Enabled = Not Command2.Enabled Command3.
21、Enabled = Not Command3.Enabled Command4.Enabled = Not Command4.Enabled If Command1.Caption = 新增 Then Command1.Caption = 确认 Adodc1.Recordset.AddNew Text1.SetFocus Else Command1.Caption = 新增 Adodc1.Recordset.Update Adodc1.Recordset.MoveLast End IfEnd SubPrivate Sub Command2_Click()On Error Resume Next
22、 Adodc1.Recordset.Delete Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveLast End IfEnd SubPrivate Sub Command3_Click()On Error Resume Next Command1.Enabled = Not Command1.Enabled Command2.Enabled = Not Command2.Enabled Command4.Enabled = Not Command4.Enabled If Command3.
23、Caption = 修改 Then Command3.Caption = 确认 Adodc1.Recordset.Requery Text1.SetFocus Else Command3.Caption = 修改 Adodc1.Recordset.Update End IfEnd SubPrivate Sub Command4_Click()On Error Resume Next Command1.Caption = 新增 Command3.Caption = 修改 Command1.Enabled = True Command2.Enabled = True Command3.Enable
24、d = True Command4.Enabled = True Adodc1.Recordset.CancelUpdate Adodc1.Recordset.MoveLastEnd SubPrivate Sub Command5_Click()Unload MeForm8.ShowEnd SubPrivate Sub Command6_Click()Adodc1.Recordset.MovePreviousIf Adodc1.Recordset.BOF Then Adodc1.Recordset.MoveLast End IfEnd SubPrivate Sub Command7_Click
25、()Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveFirst End IfEnd SubPrivate Sub Command8_Click()Adodc1.Recordset.MoveFirstEnd SubPrivate Sub Command9_Click()Adodc1.Recordset.MoveLastEnd SubPrivate Sub Label5_Click()End SubForm11的代码:Private Sub Command1_Click()Dim mno As
26、String mno = InputBox(请输入学号, 查找窗) Adodc1.Recordset.MoveFirst Adodc1.Recordset.Find 学号= & mno & If Adodc1.Recordset.EOF = True Then MsgBox 无此学号!, , 提示End SubPrivate Sub Command2_Click()Unload MeForm8.ShowEnd SubPrivate Sub Picture1_Click()End SubForm12的代码:Private Sub Command1_Click()On Error Resume N
27、ext Command2.Enabled = Not Command2.Enabled Command3.Enabled = Not Command3.Enabled Command4.Enabled = Not Command4.Enabled If Command1.Caption = 新增 Then Command1.Caption = 确认 Adodc1.Recordset.AddNew Text1.SetFocus Else Command1.Caption = 新增 Adodc1.Recordset.Update Adodc1.Recordset.MoveLast End IfEn
28、d SubPrivate Sub Command2_Click()On Error Resume Next Adodc1.Recordset.Delete Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveLast End IfEnd SubPrivate Sub Command3_Click()On Error Resume Next Command1.Enabled = Not Command1.Enabled Command2.Enabled = Not Command2.Enabled
29、 Command4.Enabled = Not Command4.Enabled If Command3.Caption = 修改 Then Command3.Caption = 确认 Adodc1.Recordset.Requery Text1.SetFocus Else Command3.Caption = 修改 Adodc1.Recordset.Update End IfEnd SubPrivate Sub Command4_Click()On Error Resume Next Command1.Caption = 新增 Command3.Caption = 修改 Command1.E
30、nabled = True Command2.Enabled = True Command3.Enabled = True Command4.Enabled = True Adodc1.Recordset.CancelUpdate Adodc1.Recordset.MoveLastEnd SubPrivate Sub Command5_Click()Unload MeForm8.ShowEnd SubPrivate Sub Command6_Click()Adodc1.Recordset.MovePreviousIf Adodc1.Recordset.BOF Then Adodc1.Recor
31、dset.MoveLast End IfEnd SubPrivate Sub Command7_Click()Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveFirst End IfEnd SubPrivate Sub Command8_Click()Adodc1.Recordset.MoveFirstEnd SubPrivate Sub Command9_Click()Adodc1.Recordset.MoveLastEnd SubPrivate Sub Picture1_Click()End Sub数据库部分:建立数据库表:-