欢迎来到天天文库
浏览记录
ID:22373704
大小:165.70 KB
页数:13页
时间:2018-10-28
《vb数据库应用编程》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、数据库应用编程学院:信息工程学院班级学号:2402090213姓名:胡刚刚日期:2011年11月27日一.1.设计界面截图2.运行截图(1)(3)在查找系中输入“数学系”,按查找3.源代码PrivateSubcmdSearch_Click()IfLen(TxtSearchDept.Text)>0ThenAdodcStudent.CommandType=adCmdTextAdodcStudent.RecordSource="select*fromstudentwhereSdept='"&_Trim(TxtSearchDept.Text)&"'"Adodc
2、Student.RefreshElseMsgBox("请指定要查找的系")EndIfEndSubPrivateSubcmdExit_Click()EndEndSubPrivateSubForm_Load()TxtSearchDept.Text=""EndSub二.1.设计界面截图2运行截图(1)(2)演示按钮末一条功能(3)添加功能演示添加+更新+第一条3.源代码PrivateSubcmdAdd_Click()AdodcStudent.Recordset.AddNewcmdAdd.Enabled=FalsecmdDel.Enabled=Falsecmd
3、Update.Enabled=TruecmdCancel.Enabled=TrueEndSubPrivateSubcmdCancel_Click()AdodcStudent.Recordset.CancelUpdatecmdAdd.Enabled=TruecmdDel.Enabled=TruecmdCancel.Enabled=FalseEndSubPrivateSubcmdDel_Click()DimresAsIntegerres=MsgBox("确实要删除此行记录吗?",vbExclamation+vbYesNo+vbDefaultButton2)
4、Ifres=vbYesThenAdodcStudent.Recordset.DeleteAdodcStudent.Recordset.MoveNextIfAdodcStudent.Recordset.EOF=TrueThenAdodcStudent.Recordset.MoveLastEndIfEndIfEndSubPrivateSubcmdExit_Click()EndEndSubPrivateSubcmdFirst_Click()AdodcStudent.Recordset.MoveFirstEndSubPrivateSubcmdLast_Clic
5、k()AdodcStudent.Recordset.MoveLastEndSubPrivateSubcmdNext_Click()AdodcStudent.Recordset.MoveNextIfAdodcStudent.Recordset.EOF=TrueThenAdodcStudent.Recordset.MoveLastEndIfEndSubPrivateSubcmdPrevious_Click()AdodcStudent.Recordset.MovePreviousIfAdodcStudent.Recordset.BOF=TrueThenAdo
6、dcStudent.Recordset.MoveFirstEndIfEndSubPrivateSubcmdUpdate_Click()AdodcStudent.Recordset.Fields("Sno")=Trim(TxtSno.Text)AdodcStudent.Recordset.Fields("Sname")=Trim(TxtSname.Text)AdodcStudent.Recordset.Fields("Ssex")=Trim(TxtSsex.Text)AdodcStudent.Recordset.Fields("Sage")=Trim(T
7、xtSage.Text)AdodcStudent.Recordset.Fields("Sdept")=Trim(TxtSdept.Text)AdodcStudent.Recordset.UpdatecmdAdd.Enabled=TruecmdDel.Enabled=TruecmdCancel.Enabled=FalseEndSubPrivateSubForm_Load()cmdCancel.Enabled=FalseEndSubPrivateSubText4_Change()EndSub三.1.设计界面截图(1)form1(2)form22.运行截图(
8、1)(2)按下查找后3.源代码(1)form1PrivateSubcmdExit_Click(
此文档下载收益归作者所有