vb和SQL做的学生成绩管理系统.docx
- 文档编号:24137251
- 上传时间:2023-05-24
- 格式:DOCX
- 页数:27
- 大小:1.36MB
vb和SQL做的学生成绩管理系统.docx
《vb和SQL做的学生成绩管理系统.docx》由会员分享,可在线阅读,更多相关《vb和SQL做的学生成绩管理系统.docx(27页珍藏版)》请在冰豆网上搜索。
vb和SQL做的学生成绩管理系统
Form1的代码:
PrivateSubCommand1_Click()
UnloadMe
Form3.Show
EndSub
PrivateSubCommand2_Click()
UnloadMe
Form2.Show
EndSub
PrivateSubCommand3_Click()
IfMsgBox("确定退出管理系统?
",_
vbQuestion+vbYesNo+vbDefaultButton2,"警告!
")=vbYesThen
End
EndIf
EndSub
PrivateSubPicture1_Click()
EndSub
PrivateSubTimer1_Timer()
Command4.Caption=Time$()
EndSub
PrivateSubForm_Load()
Timer1.Interval=1000
Timer1.Enabled=True
EndSub
Form2的代码:
PrivateSubCommand1_Click()
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find"用户名='"&Text1.Text&"'"
IfAdodc1.Recordset.EOF=TrueThenAdodc1.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
UnloadMe
Form8.Show
Else
MsgBox"非法的账号!
",vbOKOnly+vbExclamation,"请重新输入!
"
Text1.Text=""
Text2.Text=""
Text1.SetFocus
EndIf
EndSub
PrivateSubCommand2_Click()
Text1.Text=""
Text2.Text=""
EndSub
PrivateSubCommand3_Click()
UnloadMe
Form1.Show
EndSub
PrivateSubForm_Load()
Text2.Text=""
Text1.Text=""
Text2.PasswordChar="*"
EndSub
PrivateSubPicture1_Click()
EndSub
Form3的代码:
PrivateSubCommand1_Click()
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find"用户名='"&Text1.Text&"'"
IfAdodc1.Recordset.EOF=TrueThenAdodc1.Recordset.MoveFirst
If((Trim(Text1.Text))=(Trim(Text3.Text)))And((Trim(Text2.Text))=(Trim(Text4.Text)))Then
Adodc1.Enabled=False
Form4.Text1.Text=Text1.Text
Form4.Text2.Text=Text4.Text
UnloadMe
Form5.Show
Else
MsgBox"非法的账号!
",vbOKOnly+vbExclamation,"请重新输入!
"
Text1.Text=""
Text2.Text=""
Text1.SetFocus
EndIf
EndSub
PrivateSubCommand2_Click()
Option1.Value=False
Option2.Value=False
Text1.Text=""
Text2.Text=""
EndSub
PrivateSubCommand3_Click()
UnloadMe
Form1.Show
EndSub
PrivateSubForm_Load()
Text2.Text=""
Text1.Text=""
Text2.PasswordChar="*"
EndSub
无代码
Form5的代码:
PrivateSubcjcx_Click(IndexAsInteger)
UnloadMe
Form7.Show
EndSub
PrivateSubCommand1_Click()
OnErrorResumeNext
IfCommand1.Caption="修改"Then
Command1.Caption="确认"
Adodc2.Recordset.Requery
Text5.SetFocus
Else
Command1.Caption="修改"
Adodc2.Recordset.Update
MsgBox"修改成功"
EndIf
EndSub
PrivateSubForm_Load()
Adodc1.CommandType=adCmdUnknown
Adodc1.RecordSource="Select*FromstudentwelWhere用户名='"&Form4.Text1.Text&"'"
Adodc1.Refresh
Text1.Visible=True
Text3.Visible=True
Timer1.Interval=1000
Timer1.Enabled=True
EndSub
PrivateSubPicture1_Click()
EndSub
PrivateSubtcxt_Click(IndexAsInteger)
UnloadMe
Form3.Show
EndSub
PrivateSubTimer1_Timer()
Text2.Text=Time$()
EndSub
PrivateSubxgmm_Click()
Label5.Visible=True
Label7.Visible=True
Text4.Visible=True
Text5.Visible=True
Command1.Visible=True
Adodc2.CommandType=adCmdUnknown
Adodc2.RecordSource="Select*FromstudententerWhere用户名='"&Form4.Text1.Text&"'"
Adodc2.Refresh
EndSub
PrivateSubxxcx_Click(IndexAsInteger)
UnloadMe
Form6.Show
EndSub
Form6的代码:
PrivateSubCommand1_Click()
UnloadMe
Form5.Show
EndSub
PrivateSubCommand2_Click()
OnErrorResumeNext
IfCommand2.Caption="修改"Then
Text1.SetFocus
Command2.Caption="确认"
Adodc1.Recordset.Requery
MsgBox"信息修改成功"
Else
Command2.Caption="修改"
Adodc1.Recordset.Update
EndIf
EndSub
PrivateSubForm_Load()
Adodc1.CommandType=adCmdUnknown
Adodc1.RecordSource="Select*FromstudentinforWhere学号='"&Form4.Text1.Text&"'"
Adodc1.Refresh
Text1.Visible=True
Text2.Visible=True
Text3.Visible=True
Text4.Visible=True
Text5.Visible=True
Text6.Visible=True
Text7.Visible=True
Text8.Visible=True
EndSub
PrivateSubPicture1_Click()
EndSub
PrivateSubCommand1_Click()
UnloadMe
Form5.Show
EndSub
PrivateSubForm_Load()
Adodc1.Recordset.MoveFirst
DimaAsString
a=Form4.Text1.Text
Adodc1.Recordset.Find"学号='"&a&"'"
Text1.Visible=True
Text2.Visible=True
Text4.Visible=True
Text6.Visible=True
DimbAsInteger
b=Text2.Text
Ifb>=90Then
Text3.Text="优"
ElseIfb>=80Then
Text3.Text="良"
ElseIfb>=70Then
Text3.Text="中"
ElseIfb>=60Then
Text3.Text="及格"
Else
Text3.Text="不及格"
EndIf
DimcAsInteger
c=Text4.Text
Ifc>=90Then
Text5.Text="优"
ElseIfc>=80Then
Text5.Text="良"
ElseIfc>=70Then
Text5.Text="中"
ElseIfc>=60Then
Text5.Text="及格"
Else
Text5.Text="不及格"
EndIf
DimdAsInteger
d=Text6.Text
Ifd>=90Then
Text7.Text="优"
ElseIfd>=80Then
Text7.Text="良"
ElseIfd>=70Then
Text7.Text="中"
ElseIfd>=60Then
Text7.Text="及格"
Else
Text7.Text="不及格"
EndIf
IfText3.Text="不及格"Then
Text2.ForeColor=&HFF&
EndIf
IfText5.Text="不及格"Then
Text4.ForeColor=&HFF&
EndIf
IfText7.Text="不及格"Then
Text6.ForeColor=&HFF&
EndIf
EndSub
PrivateSubPicture1_Click()
EndSub
Form8的代码:
PrivateSubCommand1_Click()
OnErrorResumeNext
IfCommand1.Caption="修改"Then
Command1.Caption="确认"
Adodc1.Recordset.Requery
Text2.SetFocus
Else
Command1.Caption="修改"
Adodc1.Recordset.Update
MsgBox"修改成功"
EndIf
EndSub
PrivateSubfile1_Click()
UnloadMe
Form10.Show
EndSub
PrivateSubfile2_Click()
UnloadMe
Form9.Show
EndSub
PrivateSubfile4_Click()
UnloadMe
Form12.Show
EndSub
PrivateSubfile5_Click()
UnloadMe
Form11.Show
EndSub
PrivateSubfile7_Click()
UnloadMe
Form2.Show
EndSub
PrivateSubfile8_Click()
Label3.Visible=True
Label4.Visible=True
Text1.Visible=True
Text2.Visible=True
Command1.Visible=True
Adodc1.CommandType=adCmdUnknown
Adodc1.RecordSource="Select*FromteacherenterWhere用户名='"&Form4.Text3.Text&"'"
Adodc1.Refresh
EndSub
PrivateSubPicture1_Click()
EndSub
Form9的代码:
PrivateSubCommand1_Click()
DimmnoAsString
mno=InputBox("请输入学号","查找窗")
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find"学号='"&mno&"'"
IfAdodc1.Recordset.EOF=TrueThenMsgBox"无此学号!
",,"提示"
EndSub
PrivateSubCommand2_Click()
UnloadMe
Form8.Show
EndSub
PrivateSubCommand3_Click()
DimmnonAsString
mnon=InputBox("请输入姓名","查找窗")
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find"姓名='"&mnon&"'"
IfAdodc1.Recordset.EOF=TrueThenMsgBox"无此学号!
",,"提示"
EndSub
PrivateSubLabel5_Click()
EndSub
PrivateSubLabel7_Click()
EndSub
Form10的代码:
PrivateSubCommand1_Click()
OnErrorResumeNext
Command2.Enabled=NotCommand2.Enabled
Command3.Enabled=NotCommand3.Enabled
Command4.Enabled=NotCommand4.Enabled
IfCommand1.Caption="新增"Then
Command1.Caption="确认"
Adodc1.Recordset.AddNew
Text1.SetFocus
Else
Command1.Caption="新增"
Adodc1.Recordset.Update
Adodc1.Recordset.MoveLast
EndIf
EndSub
PrivateSubCommand2_Click()
OnErrorResumeNext
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
IfAdodc1.Recordset.EOFThen
Adodc1.Recordset.MoveLast
EndIf
EndSub
PrivateSubCommand3_Click()
OnErrorResumeNext
Command1.Enabled=NotCommand1.Enabled
Command2.Enabled=NotCommand2.Enabled
Command4.Enabled=NotCommand4.Enabled
IfCommand3.Caption="修改"Then
Command3.Caption="确认"
Adodc1.Recordset.Requery
Text1.SetFocus
Else
Command3.Caption="修改"
Adodc1.Recordset.Update
EndIf
EndSub
PrivateSubCommand4_Click()
OnErrorResumeNext
Command1.Caption="新增"
Command3.Caption="修改"
Command1.Enabled=True
Command2.Enabled=True
Command3.Enabled=True
Command4.Enabled=True
Adodc1.Recordset.CancelUpdate
Adodc1.Recordset.MoveLast
EndSub
PrivateSubCommand5_Click()
UnloadMe
Form8.Show
EndSub
PrivateSubCommand6_Click()
Adodc1.Recordset.MovePrevious
IfAdodc1.Recordset.BOFThen
Adodc1.Recordset.MoveLast
EndIf
EndSub
PrivateSubCommand7_Click()
Adodc1.Recordset.MoveNext
IfAdodc1.Recordset.EOFThen
Adodc1.Recordset.MoveFirst
EndIf
EndSub
PrivateSubCommand8_Click()
Adodc1.Recordset.MoveFirst
EndSub
PrivateSubCommand9_Click()
Adodc1.Recordset.MoveLast
EndSub
PrivateSubLabel5_Click()
EndSub
Form11的代码:
PrivateSubCommand1_Click()
DimmnoAsString
mno=InputBox("请输入学号","查找窗")
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find"学号='"&mno&"'"
IfAdodc1.Recordset.EOF=TrueThenMsgBox"无此学号!
",,"提示"
EndSub
PrivateSubCommand2_Click()
UnloadMe
Form8.Show
EndSub
PrivateSubPicture1_Click()
EndSub
Form12的代码:
PrivateSubCommand1_Click()
OnErrorResumeNext
Command2.Enabled=NotCommand2.Enabled
Command3.Enabled=NotCommand3.Enabled
Command4.Enabled=NotCommand4.Enabled
IfCommand1.Caption="新增"Then
Command1.Caption="确认"
Adodc1.Recordset.AddNew
Text1.SetFocus
Else
Command1.Caption="新增"
Adodc1.Recordset.Update
Adodc1.Recordset.MoveLast
EndIf
EndSub
PrivateSubCommand2_Click()
OnErrorResumeNext
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
IfAdodc1.Recordset.EOFThen
Adodc1.Recordset.MoveLast
EndIf
EndSub
PrivateSubCommand3_Click()
OnErrorResumeNext
Command1.Enabled=NotCommand1.Enabled
Command2.Enabled=NotCommand2.Enabled
Command4.Enabled=NotCommand4.Enabled
IfCommand3.Caption="修改"Then
Command3.Caption="确认"
Adodc1.Recordset.Requery
Text1.SetFocus
Else
Command3.Caption="修改"
Adodc1.Recordset.Update
EndIf
EndSub
PrivateSubCommand4_Click()
OnErrorResumeNext
Command1.Caption="新增"
Command3.Caption="修改"
Command1.Enabled=True
Command2.Enabled=True
Command3.Enabled=True
Command4.Enabled=True
Adodc1.Recordset.CancelUpdate
Adodc1.Recordset.MoveLast
EndSub
PrivateSubCommand5_Click()
UnloadMe
Form8.Show
EndSub
Priv
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- vb SQL 学生 成绩管理系统
