仓库管理系统VB+Access+源代码.doc

上传人:豆**** 文档编号:17476617 上传时间:2022-05-24 格式:DOC 页数:27 大小:201KB
返回 下载 相关 举报
仓库管理系统VB+Access+源代码.doc_第1页
第1页 / 共27页
仓库管理系统VB+Access+源代码.doc_第2页
第2页 / 共27页
点击查看更多>>
资源描述

《仓库管理系统VB+Access+源代码.doc》由会员分享,可在线阅读,更多相关《仓库管理系统VB+Access+源代码.doc(27页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、【精品文档】如有侵权,请联系网站删除,仅供学习与交流仓库管理系统VB+Access+源代码.精品文档.仓库管理系统项目的建立 这是本人利用闲暇之余在VB6.0上制作的一个简陋的类库管系统,现图文结合的方式一步一步展现制作过程。由于本人是个初学者,里面存在很多不足之处望得到高手们的指导。此文可作供初学者们学习交流。作者联系方式:E-mail luo.shiye QQ:1355044347最终运行效果打开软件出现如下登录界面输入系统预设用户名及密码( 1 1 )单击“登录”或单击“新用户”添加新用户进入如下主界面:建立工程1、 创建标准EXE2、 按“打开”3、 添加MDI窗体打开4、 编辑菜单在

2、空白处右击点击“菜单编辑器”在“标题”里输入“系统”,在“名称”里输入“Sys”(注意此处不能为汉字)点击“下一个”再点击“ ”“确定”退到MDI界面点击“系统”“退出”如下,然后编写代码。代码如下: Private Sub Exit_Click() EndEnd Sub数据库的建立VB6.0中可以创建Access数据库。如下建立一个“用户表”的数据库,用来存放用户信息及一些出入库管理信息。如下图单击“外接程序”再单击“可视化数据管理器”出现如图点击“文件”“新建”“Microsoft Access”“Version 2.0 MDB”输入数据库名,“保存”出现如下图在数据窗口中右击“新建表”,

3、最终如下往数据表里添加数据在这里就不罗嗦了,请查阅相关书籍。登录界面窗口的建立 最终界面如下:1、Adodc1的添加过程为:单击“工程”“部件”出现下图所示,选择“控件”下的“Microsoft ADO Data Control 6.0 (OLEDB)” 单击“确定”在工具栏中会出现“”图标,单击它并拖动到相应位置即可。其它元件不在一一说明。2、 本窗体代码如下:Private Sub Command1_Click() “登录”、“确定”按钮 If Command1.Caption = 确定 And Command2.Caption = 取消 Then 如果为“确定”则添加新用户 If Tex

4、t1.Text = Then 提示用户输入用户名 MsgBox 请输入用户名!, , 登录信息提示: Exit Sub Else Dim usename As String 检测用户名是否已经存在 Dim strS As String usename = Trim(Text1.Text) strS = select * from 用户登录信息表 where 用户名= & usename & Adodc1.CommandType = adCmdText Adodc1.RecordSource = strS Adodc1.Refresh If Adodc1.Recordset.EOF = Fals

5、e Then MsgBox 您输入的用户已存在!, , 登录提示信息: Text1.Text = Text2.Text = Text3.Text = Text1.SetFocus Exit Sub End If End If If Text2.Text = Then 提示用户密码不能为空 MsgBox 密码不能为空!, , 登录提示信息: Text2.SetFocus Exit Sub End If If Text3.Text = Then MsgBox 请再次输入密码!, , 登录提示信息: Text3.SetFocus Exit Sub End If If Text2.Text Text3

6、.Text Then MsgBox 两次输入的密码不一致,请确认!, , 登录提示信息: Text2.Text = Text3.Text = Text2.SetFocus Exit Sub Else Adodc1.Recordset.AddNew 添加新用户 Adodc1.Recordset.Fields(用户名) = Trim(Text1.Text) Adodc1.Recordset.Fields(密码) = Trim(Text2.Text) Adodc1.Recordset.Update MsgBox (添加新用户成功,现在您可以登陆系统了!) Label3.Visible = False

7、 Text3.Visible = False Command1.Caption = 登录 Command2.Caption = 退出 End If Else “登录”按钮,用户登录 Dim strSno As String Dim strSelect As String strSno = Trim(Text1.Text) 检测用户名是否存在 strSelect = select 密码 from 用户登录信息表 where 用户名 = & strSno & Adodc1.CommandType = adCmdText Adodc1.RecordSource = strSelect Adodc1.

8、Refresh If Adodc1.Recordset.EOF = True Then MsgBox 用户名不存在,请重新输入!, , 登录提示信息: Text1.Text = Text2.Text = Text1.SetFocus Exit Sub End If If Adodc1.Recordset.Fields(密码) = Trim(Text2.Text) Then 检测密码是否正确 Form1.Hide Unload Me Form2.Show MsgBox 登陆成功!, , 登录提示信息: Else MsgBox 密码不正确,请重新输入!, , 登录提示信息: Text2.Text

9、= Text2.SetFocus End If End IfEnd SubPrivate Sub Command2_Click() “退出”或“取消”按钮 If Command2.Caption = 取消 Then Label3.Visible = False Text3.Visible = False Command1.Caption = 登录 Command2.Caption = 退出 Text1.Text = Text2.Text = Text1.SetFocus Else End Unload Me End IfEnd SubPrivate Sub Command3_Click() “

10、新用户”按钮 Label3.Visible = True Text3.Visible = True Text1.Text = Text2.Text = Text3.Text = Command1.Caption = 确定 Command2.Caption = 取消 Text1.SetFocusEnd SubPrivate Sub Command3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Label6.Visible = TrueEnd SubPrivate Sub Command3_Mou

11、seUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Label6.Visible = FalseEnd SubPrivate Sub Form_Load() Label3.Visible = False Text3.Visible = FalseEnd SubPrivate Sub Timer1_Timer() 时间time1控件的time事件代码,用来 显示向左移动的欢迎字幕 If Label4.Left + Label4.Width 0 Then 当标签右边位置大于0时,标签向左移 Label4.Move

12、Label4.Left - 80 Else 否则标签从头开始 Label4.Left = Form1.ScaleWidth End If If Label5.Left + Label5.Width 0 Then Label5.Move Label5.Left - 80 Else Label5.Left = Form1.ScaleWidth End IfEnd Sub主界面窗体如下:代码: Private Sub AddNew_Click() Frame1.Visible = True Frame2.Visible = FalseEnd SubPrivate Sub CHKPMCHX_Click

13、() Frame2.Caption = 出库信息 Dim pm As String Dim n As String pm = InputBox(产品名, 请输入, 0) n = select * from 出库表 where 品名 = & pm & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid1End SubPrivate Sub CHKXHCHX_Click() Frame2.Caption = 出库信息 Dim XH As String Dim n As String

14、XH = InputBox(产品型号, 请输入, 0) n = select * from 出库表 where 型号 = & XH & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.RefreshEnd SubPrivate Sub CKCZ_Click() Form2.Hide Form6.ShowEnd SubPrivate Sub CKJSHR_Click() Frame2.Caption = 出库信息 Dim JSHR As String Dim n As String JSHR = InputBox(经手人

15、, 请输入, 0) n = select * from 出库表 where 经手人 = & JSHR & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid1End SubPrivate Sub CKSHJ_Click() Frame2.Caption = 出库信息 Dim CHKRQ As String Dim n As String CHKRQ = InputBox(出库日期,格式为:月/日/年 如:12/1/2011, 请输入, 0) n = select * from 出

16、库表 where 出库日期 = & CHKRQ & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid1End SubPrivate Sub CKZCX_Click() Frame2.Caption = 出库信息 Dim ZB As String ZB = select * from 出库表 Adodc2.CommandType = adCmdText Adodc2.RecordSource = ZB Adodc2.Refresh Call InitGrid1End SubPri

17、vate Sub Command1_Click() If Text1.Text = Then 提示用户输入用户名 MsgBox 请输入用户名!, , 登录信息提示: Exit Sub Else Dim usename As String 检测用户名是否已经存在 Dim strS As String usename = Trim(Text1.Text) strS = select * from 用户登录信息表 where 用户名= & usename & Adodc1.CommandType = adCmdText Adodc1.RecordSource = strS Adodc1.Refres

18、h If Adodc1.Recordset.EOF = False Then MsgBox 您输入的用户已存在!, , 登录提示信息: Text1.Text = Text2.Text = Text3.Text = Text1.SetFocus Exit Sub End If End If If Text2.Text = Then 提示用户密码不能为空 MsgBox 密码不能为空!, , 登录提示信息: Text2.SetFocus Exit Sub End If If Text3.Text = Then MsgBox 请再次输入密码!, , 登录提示信息: Text3.SetFocus Exi

19、t Sub End If If Text2.Text Text3.Text Then MsgBox 两次输入的密码不一致,请确认!, , 登录提示信息: Text2.Text = Text3.Text = Text2.SetFocus Exit Sub Else Adodc1.Recordset.AddNew 添加新用户 Adodc1.Recordset.Fields(用户名) = Trim(Text1.Text) Adodc1.Recordset.Fields(密码) = Trim(Text2.Text) Adodc1.Recordset.Update Dim X As Integer X

20、= MsgBox(成功添加新用户,是否要重新登录!, vbYesNo + vbQuestion + vbDefaultButton1, 提示信息!) If X = vbYes Then Unload Me Form3.Show End If MsgBox (成功添加新用户!) Label3.Visible = False Text3.Visible = False Command1.Caption = 登录 Command2.Caption = 退出 End If Frame1.Visible = False Frame2.Visible = True Text1.Text = Text2.T

21、ext = Text3.Text = Form3.ShowEnd SubPrivate Sub Command2_Click() Frame1.Visible = False Frame2.Visible = TrueEnd SubPrivate Sub CXDL_Click() Form3.Show Unload MeEnd SubPrivate Sub Exit_Click() End Unload Form1 Unload Form2 Unload Form3 Unload Form4 Unload Form5 Unload Form6 Unload Form7 Unload Form8

22、End SubPrivate Sub Form_Load() TextUserName = Trim(Form1.Text1.Text) Unload Form1 Frame1.Visible = False Call InitGrid0 Me.Height = MDIForm1.Height - 1060 Me.Width = MDIForm1.Width - 560 Me.Top = MDIForm1.Top Me.Left = MDIForm1.LeftEnd SubPrivate Sub GHCZ_Click() Form2.Hide Form8.ShowEnd SubPrivate

23、Sub GHPMCX_Click() Frame2.Caption = 归还信息 Dim pm As String Dim n As String pm = InputBox(产品名, 请输入, 0) n = select * from 归还表 where 品名 = & pm & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub GHRCX_Click() Frame2.Caption = 归还信息 Dim JCR As String Di

24、m n As String JCR = InputBox(归还人, 请输入, 0) n = select * from 归还表 where 归还人 = & JCR & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub GHSJCX_Click() Frame2.Caption = 归还信息 Dim JCRQ As String Dim n As String JCRQ = InputBox(归还日期,格式为:月/日/年 如:12/1/201

25、1, 请输入, 0) n = select * from 归还表 where 归还日期 = & JCRQ & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub GHXHCX_Click() Frame2.Caption = 归还信息 Dim XH As String Dim n As String XH = InputBox(产品型号, 请输入, 0) n = select * from 归还表 where 型号 = & XH & Adod

26、c2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub GHZCX_Click() Frame2.Caption = 归还信息 Dim ZB As String ZB = select * from 归还表 Adodc2.CommandType = adCmdText Adodc2.RecordSource = ZB Adodc2.Refresh Call InitGrid2End SubPrivate Sub JCCZ_Click() Form2.Hi

27、de Form7.ShowEnd SubPrivate Sub JCHPMCHX_Click() Frame2.Caption = 借出信息 Dim pm As String Dim n As String pm = InputBox(产品名, 请输入, 0) n = select * from 借出表 where 品名 = & pm & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub JCHXHCHX_Click() Frame2.Ca

28、ption = 借出信息 Dim XH As String Dim n As String XH = InputBox(产品型号, 请输入, 0) n = select * from 借出表 where 型号 = & XH & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub JCRCX_Click() Frame2.Caption = 借出信息 Dim JCR As String Dim n As String JCR = InputBo

29、x(借出人, 请输入, 0) n = select * from 借出表 where 借出人 = & JCR & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub JCSHJCX_Click() Frame2.Caption = 借出信息 Dim JCRQ As String Dim n As String JCRQ = InputBox(借出日期,格式为:月/日/年 如:12/1/2011, 请输入, 0) n = select * fr

30、om 借出表 where 借出日期 = & JCRQ & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub JCZCX_Click() Frame2.Caption = 借出信息 Dim ZB As String ZB = select * from 借出表 Adodc2.CommandType = adCmdText Adodc2.RecordSource = ZB Adodc2.Refresh Call InitGrid2End Sub

31、Private Sub JSHRCHX_Click() Frame2.Caption = 归还信息 Dim JSHR As String Dim n As String JSHR = InputBox(经手人, 请输入, 0) n = select * from 归还表 where 经手人 = & JSHR & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub JSHRCX_Click() Frame2.Caption = 借出信息 Dim

32、 JSHR As String Dim n As String JSHR = InputBox(经手人, 请输入, 0) n = select * from 借出表 where 经手人 = & JSHR & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid2End SubPrivate Sub PMCX_Click() Frame2.Caption = 库存信息 Dim pm As String Dim n As String pm = InputBox(产品名, 请输入, 0

33、) n = select * from 库存表 where 品名 = & pm & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid0End SubPrivate Sub RKCZ_Click() Form2.Hide Form5.ShowEnd SubPrivate Sub RKJSHR_Click() Frame2.Caption = 入库信息 Dim JSHR As String Dim n As String JSHR = InputBox(经手人, 请输入, 0) n

34、 = select * from 入库表 where 经手人 = & JSHR & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid1End SubPrivate Sub RKPMCHX_Click() Frame2.Caption = 入库信息 Dim pm As String Dim n As String pm = InputBox(产品名, 请输入, 0) If Len(pm) 0 Then n = select * from 入库表 where 品名 = & pm &

35、 Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.Refresh End If Call InitGrid1End SubPrivate Sub RKSHJ_Click() Frame2.Caption = 入库信息 Dim RKRQ As String Dim n As String RKRQ = InputBox(入库日期,格式为:月/日/年 如:12/1/2011, 请输入, 0) n = select * from 入库表 where 入库日期 = & RKRQ & Adodc2.CommandType = a

36、dCmdText Adodc2.RecordSource = n Adodc2.Refresh Call InitGrid1End SubPrivate Sub RKXHCHX_Click() Frame2.Caption = 入库信息 Dim XH As String Dim n As String XH = InputBox(产品型号, 请输入, 0) If Len(XH) 0 Then n = select * from 入库表 where 型号 = & XH & Adodc2.CommandType = adCmdText Adodc2.RecordSource = n Adodc2.

37、Refresh End If Call InitGrid1End SubPrivate Sub RKZCX_Click() Frame2.Caption = 入库信息 Dim ZB As String ZB = select * from 入库表 Adodc2.CommandType = adCmdText Adodc2.RecordSource = ZB Adodc2.Refresh Call InitGrid1End SubPrivate Sub Timer1_Timer() If Label4.Left + Label4.Width 0 Then 当标签右边位置大于0时,标签向左移 Label4.Move Label4.Le

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 小学资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁