《库存管理系统课程设计教程文件.doc》由会员分享,可在线阅读,更多相关《库存管理系统课程设计教程文件.doc(21页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Good is good, but better carries it.精益求精,善益求善。库存管理系统课程设计-Oracle课程设计报告设计题目:库存管理系统姓名:XXXXX班级:XXXX学号:XXXXX指导老师:XXXX2011年11月1. 库存管理系统登录注册界面及代码PrivateSubCommand1_Click()DimUserNameAsStringDimPassWordAsStringDimconnAsNewADODB.ConnectionDimrsAsNewADODB.RecordsetDimStrSQLAsStringconn.OpenProvider=Microsoft.
2、Jet.OLEDB.4.0;DataSource=C:Users尤远明Desktop库存管理库存.mdbUserName=Trim(Text1.Text)PassWord=Trim(Text2.Text)IfUserName=OrPassWord=ThenMsgBox对不起,用户或密码不能为空!请重新输入!,vbCritical,错误ElseIfUserNameEmptyAndPassWordEmptyThenStrSQL=select*from用户where用户名=&UserName&and密码=&PassWord&rs.OpenStrSQL,conn,adOpenKeyset,adLock
3、PessimisticIfrs.EOF=TrueThenMsgBox对不起,无此用户或者密码不正确!请重新输入!,vbCritical,错误Text1.Text=Text2.Text=Text1.SetFocusrs.CloseElse登陆成功,以下为权限验证Form4.ShowUnloadMeEndIfEndIfEndSubPrivateSubCommand2_Click()EndEndSubPrivateSubCommand3_Click()Form8.ShowEndSub库存供应商信息添加修改删除界面及代码PrivateSubCommand1_Click()Adodc1.Recordse
4、t.AddNewAdodc1.Recordset.Fields(用户名)=Text1.TextAdodc1.Recordset.Fields(密码)=Text2.TextAdodc1.Recordset.UpdateEndSubPrivateSubCommand2_Click()Me.HideForm1.ShowEndSubPrivateSubCommand1_Click()IfCommand1.Caption=添加ThenCommand1.Caption=更新Data1.Recordset.AddNewText1=Text2=Text3=Text4=Text5=Text6.Text=CStr
5、(Now()Text1.SetFocusElseText6.Text=CStr(Now()Command1.Caption=添加Data1.Recordset(货品号)=Text1Data1.Recordset(货品名)=Text2Data1.Recordset(供应商)=Text3Data1.Recordset(单价)=Text4Data1.Recordset(数量)=Text5Data1.Recordset(时间)=Text6Data1.Recordset.UpdateEndIfEndSubPrivateSubCommand2_Click()Data1.Recordset.EditData
6、1.Recordset(货品号)=Text1Data1.Recordset(货品名)=Text2Data1.Recordset(供应商)=Text3Data1.Recordset(单价)=Text4Data1.Recordset(数量)=Text5Data1.Recordset(时间)=Text6Data1.Recordset.UpdateEndSubPrivateSubCommand3_Click()IfMsgBox(你确定要删除&Text2.Text&的信息吗?,vbOKCancel+vbDefaultButton2)=vbOKThenData1.Recordset.DeleteData1
7、.Recordset.MoveNextEndIfEndSubPrivateSubcommand4_Click()Me.HideForm4.ShowEndSubPrivateSubForm_Load()Text6.Text=CStr(Now()EndSubPrivateSubCommand1_Click()Ifcommand1.Caption=添加Thencommand1.Caption=更新Data1.Recordset.AddNewText1=Text2=Text3=Text4=Text5=Text1.SetFocusElsecommand1.Caption=添加Data1.Recordse
8、t(供应商编号)=Text1Data1.Recordset(供应商名称)=Text2Data1.Recordset(业务联系人)=Text3Data1.Recordset(联系电话)=Text4Data1.Recordset(传真)=Text5Data1.Recordset.UpdateEndIfEndSubPrivateSubCommand2_Click()IfMsgBox(你确定要删除&Text1.Text&的信息吗?,vbOKCancel+vbDefaultButton2)=vbOKThenData1.Recordset.DeleteData1.Recordset.MoveNextEnd
9、IfEndSubPrivateSubCmd_command3_Click()Data1.Recordset.EditData1.Recordset(供应商编号)=Text1Data1.Recordset(供应商名称)=Text2Data1.Recordset(业务联系人)=Text3Data1.Recordset(联系电话)=Text4Data1.Recordset(传真)=Text5Data1.Recordset.UpdateEndSubPrivateSubcommand4_Click()Me.HideForm4.ShowEndSub2. 删除/修改要先进行查询需要的信息功能图及代码如下Pr
10、ivateSubCommand1_Click()IfText1.TextThenForm2.Data1.Recordset.MoveFirstForm2.Data1.Recordset.FindFirst(货品名=&Text1&)IfForm2.Data1.Recordset.NoMatchThenMsgBox(没有匹配的记录,请重新输入)Text1.SetFocusElseForm2.Text1=Form2.Data1.Recordset(货品号)Form2.Text2=Form2.Data1.Recordset(货品名)Form2.Text3=Form2.Data1.Recordset(供
11、应商)Form2.Text4=Form2.Data1.Recordset(单价)Form2.Text5=Form2.Data1.Recordset(数量)Form3.HideForm2.ShowEndIfElseIfText2.TextThenForm2.Data1.Recordset.MoveFirstForm2.Data1.Recordset.FindFirst(供应商=&Text2&)IfForm2.Data1.Recordset.NoMatchThenMsgBox(没有匹配的记录,请重新输入)Text2.SetFocusElseForm2.Text1=Form2.Data1.Recor
12、dset(货品号)Form2.Text2=Form2.Data1.Recordset(货品名)Form2.Text3=Form2.Data1.Recordset(供应商)Form2.Text4=Form2.Data1.Recordset(单价)Form2.Text5=Form2.Data1.Recordset(数量)Form3.HideForm2.ShowEndIfElseIfText3.TextThenForm2.Data1.Recordset.MoveFirstForm2.Data1.Recordset.FindFirst(货品号=&Text3&)IfForm2.Data1.Records
13、et.NoMatchThenMsgBox(没有匹配的记录,请重新输入)Text3.SetFocusElseForm2.Text1=Form2.Data1.Recordset(货品号)Form2.Text2=Form2.Data1.Recordset(货品名)Form2.Text3=Form2.Data1.Recordset(供应商)Form2.Text4=Form2.Data1.Recordset(单价)Form2.Text5=Form2.Data1.Recordset(数量)Form3.HideForm2.ShowEndIfElseMsgBox(你至少选择一种查询方式)EndIfEndSub
14、PrivateSubCommand2_Click()Me.HideForm4.ShowEndSub3. 查询库存供应商信息功能图及代码PrivateSubCommand1_Click()Me.HideForm4.ShowEndSubPrivateSubCommand2_Click()DimStrSQLAsStringIfText1.TextThenAdodc1.Recordset.CloseIfVal(Text1.Text)0ThenStrSQL=select*from库存where货品号=&Trim(Text1.Text)&ElseStrSQL=select*from库存where货品名=&
15、Trim(Text1.Text)&EndIfAdodc1.CommandType=adCmdTextAdodc1.Recordset.OpenStrSQLSetDataGrid1.DataSource=Adodc1ElseSetDataGrid1.DataSource=NothingEndIfEndSubPrivateSubCommand1_Click()Me.HideForm4.ShowEndSubPrivateSubCommand2_Click()DimStrSQLAsStringIfText1.TextThenAdodc1.Recordset.CloseIfVal(Text1.Text)0ThenStrSQL=select*from供应商where供应商编号=&Trim(Text1.Text)&ElseStrSQL=select*from供应商where供应商名称=&Trim(Text1.Text)&EndIfAdodc1.CommandType=adCmdTextAdodc1.Recordset.OpenStrSQLSetDataGrid1.DataSource=Adodc1ElseSetDataGrid1.DataSource=NothingEndIfEndSub-
限制150内