欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    vb+sql2000图书管理系统.doc

    • 资源ID:70334790       资源大小:2.27MB        全文页数:30页
    • 资源格式: DOC        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    vb+sql2000图书管理系统.doc

    Vb+sql2000图书管理代码及控件主要控件:Commandbutton,textbox,frame,label, Toolbar, ProgressBar, CommonDialog, Timer, StatusBar, ImageList, Adodc, DataGrid主界面模型图:图书管理主界面图书信息管理图书借阅管理读者信息管理添加修改删除图书信息图书所有信息查询图书信息添加修改删除借阅信息图书借阅查询添加删除修改读者信息查询读者信息1.登录界面设计过程:用于输入用户名和密码登录,若是用户输入用户名和密码错误则不能进入系统。界面是一个GIF图片。来自于第三方控件。代码:Private Sub cmdok_Click()Dim cn As New ADODB.ConnectionDim rs As New ADODB.RecordsetDim flag As BooleanDim cn_str As String, sql_str As Stringcn_str = "DRIVER=SQL SERVER;SERVER=QA2ONHYK7VWHRY2;DATABASE=library"cn.Open cn_strsql_str = "select username ,userp from user_info"rs.Open sql_str, cnWhile Not rs.EOFIf txtusername.Text = Trim(rs(0) And txtpassword.Text = Trim(rs(1) ThenMe.Hide form8.Showflag = TrueExit SubElsers.MoveNextflag = FalseEnd IfWendIf flag = False ThenMsgBox "输入的用户名或密码有误,请重新输入!", vbCritical + vbOKOnly, "错误"rs.CloseEnd IfEnd SubPrivate Sub Command1_Click()If MsgBox("你确定要退出?", vbYesNo) = vbNo Thenfrmlogin.ShowElseUnload MeEnd IfEnd SubPrivate Sub txtpassword_GotFocus()txtpassword = ""txtpassword.PasswordChar = "*"End SubPrivate Sub txtusername_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Static Toogle As BooleanIf Toogle = False Thentxtusername = ""Toogle = TrueEnd If2图书管理主界面设计过程:所有功能都在菜单中打开来实现。设计代码:Private Sub adu_Click(Index As Integer) form3.ShowEnd SubPrivate Sub b_Click()DataReport1.ShowEnd SubPrivate Sub BEI_Click() form4.ShowEnd SubPrivate Sub Command1_Click()frmaduinfo.ShowEnd SubPrivate Sub Command2_Click()frmseekxs.ShowEnd SubPrivate Sub Command3_Click()frmaduclass_info.ShowEnd SubPrivate Sub Command4_Click()frmaduclass_info.ShowEnd SubPrivate Sub Command5_Click()frmadu_course.ShowEnd SubPrivate Sub Command6_Click()frminquire_course.ShowEnd SubPrivate Sub Command7_Click()frmmodify_result.ShowEnd SubPrivate Sub Command8_Click()frminquire_result.ShowEnd SubPrivate Sub MDIForm_Load()Me.Left = GetSetting(App.Title, "setting", "mainleft", 1000)Me.Top = GetSetting(App.Title, "setting", "maintop", 1000)Me.Width = GetSetting(App.Title, "setting", "mainwidth", 1000)Me.Height = GetSetting(App.Title, "setting", "mainheight", 1000)End SubPrivate Sub MDIForm_Unload(Cancel As Integer)If Me.WindowState <> vbMinimized ThenSaveSetting App.Title, "settings", "mainleft", Me.LeftSaveSetting App.Title, "settings", "maintop", Me.TopSaveSetting App.Title, "settings", "mainwidth", Me.WidthSaveSetting App.Title, "settings", "mainheight", Me.HeightEnd IfEnd SubPrivate Sub cxbj_Click(Index As Integer)frminquire_bj_info.ShowEnd SubPrivate Sub Command9_Click()DataReport1.ShowEnd SubPrivate Sub cxcj_Click(Index As Integer)frminquire_result.ShowEnd SubPrivate Sub c_Click()Form10.ShowEnd SubPrivate Sub cxkc_Click(Index As Integer) form6.ShowEnd SubPrivate Sub cxxs_Click(Index As Integer) form9.ShowEnd SubPrivate Sub Form_Load()StatusBar1.Panels(3).Text = Format(Now, "yyyy年mm月dd日 ")StatusBar1.Panels(4).Text = Format(Now, " hh点mm分ss秒")End SubPrivate Sub hai_Click() form5.ShowEnd SubPrivate Sub Label1_Click()Label1.ForeColor = RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)End SubPrivate Sub s_Click()Form11.ShowEnd SubPrivate Sub tc_Click()Unload MeEndEnd SubPrivate Sub Timer1_Timer()StatusBar1.Panels(3).Text = Format(Now, "yyyy年mm月dd日 ")StatusBar1.Panels(4).Text = Format(Now, " hh点mm分ss秒")Label1.ForeColor = RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)End SubPrivate Sub tjbj_Click(Index As Integer) form2.ShowEnd SubPrivate Sub tjcj_Click(Index As Integer)frmmodify_result.ShowEnd SubPrivate Sub tjkc_Click(Index As Integer)form1.ShowEnd SubPrivate Sub tjxs_Click()frmadd_s_info.ShowEnd SubPrivate Sub xgcj_Click(Index As Integer)frmmodify_result.ShowEnd SubPrivate Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.key Case "tt" form3.ShowCase "ct" form9.Show Case "tj" form2.Show Case "xj" form2.Show Case "td" form1.Show Case "cd" form6.Show Case "exit" End End SelectEnd Sub3.2.1图书信息管理 3.2.1.1添加修改删除图书信息 添加修改删除图书信息设计过程:选择添加修改删除图书信息,在相应的栏目填入或选择相应的内容,点击相应的按钮可以实现添加修改删除图书信息。设计代码:Dim rs As New ADODB.RecordsetPrivate Sub Command1_Click()rs.Deleters.AddNewrs("图书号") = Trim(Text1.Text)rs("书籍名称") = Trim(Text2.Text)rs("作者") = Trim(Text3.Text)rs("出版社") = Trim(Text4.Text)rs("订购价格") = Trim(Text5.Text)rs("附件") = Trim(Text6.Text)rs("条码号") = Trim(Text7.Text)rs("规定天数") = Trim(Text8.Text)rs("书的状态") = Trim(Text9.Text)rs.UpdateMsgBox "修改信息成功!", vbExclamation + vbOKOnly, "提示"End SubPrivate Sub Command2_Click()rs.DeleteMsgBox "删除成功!", vbExclamation + vbOKOnly, "提示"End SubPrivate Sub Command3_Click(Index As Integer)Select Case IndexCase 0rs.MoveFirstFrame2.Caption = "当前位置" & rs.AbsolutePosition & "/" & rs.RecordCountCase 1rs.MovePreviousIf rs.BOF Thenrs.MoveFirstFrame2.Caption = "当前位置" & rs.AbsolutePosition & "/" & rs.RecordCountMsgBox "已经是第一条记录", vbExclamation, "提示"End IfCase 2rs.MoveNextFrame2.Caption = "当前位置" & rs.AbsolutePosition & "/" & rs.RecordCountIf rs.EOF Thenrs.MoveLastMsgBox "已经是最后一条记录!", vbExclamation, "提示"End IfCase 3rs.MoveLastFrame2.Caption = "当前位置" & rs.AbsolutePosition & "/" & rs.RecordCountEnd SelectText1.Text = rs(0)Text2.Text = rs(1)Text3.Text = rs(2)Text4.Text = rs(3)Text5.Text = rs(4)Text6.Text = rs(5)Text7.Text = rs(6)Text8.Text = rs(7)Text9.Text = rs(8)End SubPrivate Sub Command4_Click()If Text1.Text = "" ThenMsgBox "请输入图书号!", vbOKOnly + vbExclamation, "警告"Text1.SetFocusExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请输入书籍名称!", vbOKOnly + vbExclamation, "警告"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请输入作者!", vbOKOnly + vbExclamation, "警告"Combo1.SetFocusExit SubEnd IfIf Text4.Text = "" ThenMsgBox "请输入出版社!", vbOKOnly + vbExclamation, "警告"Text4.SetFocusExit SubEnd IfIf Text5.Text = "" ThenMsgBox "请输入订购价格!", vbOKOnly + vbExclamation, "警告"Text5.SetFocusExit SubEnd IfIf Text6.Text = "" ThenMsgBox "请输入附件!", vbOKOnly + vbExclamation, "警告"Text4.SetFocusExit SubEnd IfIf Text7.Text = "" ThenMsgBox "请输入条码号!", vbOKOnly + vbExclamation, "警告"Text7.SetFocusExit SubEnd IfIf Text8.Text = "" ThenMsgBox "请输入规定天数!", vbOKOnly + vbExclamation, "警告"Text8.SetFocusExit SubEnd IfIf Text9.Text = "" ThenMsgBox "请输入书的状态!", vbOKOnly + vbExclamation, "警告"Text9.SetFocusExit SubEnd IfDim cn As New ADODB.ConnectionDim rs As New ADODB.RecordsetDim flag As BooleanDim cn_str As String, sql_str As Stringcn_str = "DRIVER=SQL SERVER;SERVER=QA2ONHYK7VWHRY2;DATABASE=library"cn.Open cn_strsql_str = "select *from 图书基本信息表"rs.Open sql_str, cn, adOpenDynamic, adLockOptimisticrs.AddNewrs("图书号") = Trim(Text1.Text)rs("书籍名称") = Trim(Text2.Text)rs("作者") = Trim(Text3.Text)rs("出版社") = Trim(Text4.Text)rs("订购价格") = Trim(Text5.Text)rs("附件") = Trim(Text6.Text)rs("条码号") = Trim(Text7.Text)rs("规定天数") = Trim(Text8.Text)rs("书的状态") = Trim(Text9.Text)rs.Updaters.CloseMsgBox "添加信息成功!", vbExclamation + vbOKOnly, "提示"End SubPrivate Sub Form_Load()Dim cn As New ADODB.ConnectionDim cn_str As String, sql_str As Stringcn_str = "DRIVER=SQL SERVER;SERVER=QA2ONHYK7VWHRY2;DATABASE=library"cn.Open cn_strsql_str = "select * from 图书基本信息表"rs.CursorLocation = adUseClientrs.Open sql_str, cn_str, adOpenDynamic, adLockOptimisticText1.Text = rs(0)Text2.Text = rs(1)Text3.Text = rs(2)Text4.Text = rs(3)Text5.Text = rs(4)Text6.Text = rs(5)Text7.Text = rs(6)Text8.Text = rs(7)Text9.Text = rs(8)End SubPrivate Sub Form_Unload(Cancel As Integer)rs.CloseEnd Sub3.3.1.3查询图书信息查询图书信息图设计过程:选择查询图书信息,在相应的栏目输入要查询的图书号就能查询该图书的基本信息设计代码:Private Sub Command1_Click()Dim cn As New ADODB.ConnectionDim rs As New ADODB.RecordsetDim flag As BooleanDim cn_str As String, sql_str As Stringcn_str = "DRIVER=SQL SERVER;SERVER=QA2ONHYK7VWHRY2;DATABASE=library"cn.Open cn_strsql_str = "select * from 图书基本信息表"rs.Open sql_str, cnWhile Not rs.EOFIf Text10.Text = Trim(rs(0) ThenText1.Text = rs(0)Text2.Text = rs(1)Text3.Text = rs(2)Text4.Text = rs(3)Text5.Text = rs(4)Text6.Text = rs(5)Text7.Text = rs(6)Text8.Text = rs(7)Text9.Text = rs(8)flag = TrueExit SubElsers.MoveNextflag = FalseEnd IfWendIf flag = False ThenMsgBox "没有找到此图书的信息,请确认所输入正确的图书号!", vbCritical + vbOKOnly, "错误"rs.CloseEnd IfEnd Sub3.2.2图书借阅管理3.2.2.1添加修改删除借阅信息添加修改删除借阅信息图设计过程:选择添加修改删除借阅信息,在相应的栏目填入或选择相应的内容,点击相应的按钮可以实现添加修改删除借阅信息。设计代码:Dim rs As New ADODB.RecordsetPrivate Sub Command1_Click()rs.Deleters.AddNewrs("条码号") = Trim(Text1.Text)rs("读者编号") = Trim(Text2.Text)rs("书籍名称") = Trim(Text3.Text)rs("图书作者") = Trim(Text4.Text)rs("规定天数") = Trim(Text5.Text)rs("借出日期") = Trim(Text6.Text)rs("还书日期") = Trim(Text7.Text)rs("实还日期") = Trim(Text8.Text)rs("超出天数") = Trim(Text9.Text)rs.UpdateMsgBox "修改信息成功!", vbExclamation + vbOKOnly, "提示"End SubPrivate Sub Command2_Click()rs.Deleters.UpdateMsgBox "删除成功!", vbExclamation + vbOKOnly, "提示"End SubPrivate Sub Command3_Click(Index As Integer)Select Case IndexCase 0rs.MoveFirstCase 1rs.MovePreviousIf rs.BOF Thenrs.MoveFirstMsgBox "已经是第一条记录", vbExclamation, "提示"End IfCase 2rs.MoveNextIf rs.EOF Thenrs.MoveLastMsgBox "已经是最后一条记录!", vbExclamation, "提示"End IfCase 3rs.MoveLastEnd SelectText1.Text = rs(0)Text2.Text = rs(1)Text3.Text = rs(2)Text4.Text = rs(3)Text5.Text = rs(4)Text6.Text = rs(5)Text7.Text = rs(6)Text8.Text = rs(7)Text9.Text = rs(8)End SubPrivate Sub Command4_Click()If Text1.Text = "" ThenMsgBox "请输入条码号!", vbOKOnly + vbExclamation, "警告"Text1.SetFocusExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请输入读者编号!", vbOKOnly + vbExclamation, "警告"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请输入书籍名称!", vbOKOnly + vbExclamation, "警告"Text3.SetFocusExit SubEnd IfIf Text4.Text = "" ThenMsgBox "请输入图书作者!", vbOKOnly + vbExclamation, "警告"Text4.SetFocusExit SubEnd IfIf Text5.Text = "" ThenMsgBox "请输入规定天数!", vbOKOnly + vbExclamation, "警告"Text5.SetFocusExit SubEnd IfIf Text6.Text = "" ThenMsgBox "请输入借出日期!", vbOKOnly + vbExclamation, "警告"Text6.SetFocusExit SubEnd IfIf Text7.Text = "" ThenMsgBox "请输入还书日期!", vbOKOnly + vbExclamation, "警告"Text7.SetFocusExit SubEnd IfIf Text8.Text = "" ThenMsgBox "请输入实还日期!", vbOKOnly + vbExclamation, "警告"Text8.SetFocusExit SubEnd IfIf Text9.Text = "" ThenMsgBox "请输入超出天数!", vbOKOnly + vbExclamation, "警告"Text9.SetFocusExit SubEnd IfDim cn As New ADODB.ConnectionDim rs As New ADODB.RecordsetDim flag As BooleanDim cn_str As String, sql_str As Stringcn_str = "DRIVER=SQL SERVER;SERVER=QA2ONHYK7VWHRY2;DATABASE=library"cn.Open cn_strsql_str = "select * from 借阅信息表"rs.Open sql_str, cn, adOpenDynamic, adLockOptimisticrs.AddNewrs("条码号") = Trim(Text1.Text)rs("读者编号") = Trim(Text2.Text)rs("书籍名称") = Trim(Text3.Text)rs("图书作者") = Trim(Text4.Text)rs("规定天数") = Trim(Text5.Text)rs("借出日期") = Trim(Text6.Text)rs("还书日期") = Trim(Text7.Text)rs("实还日期") = Trim(Text8.Text)rs("超出天数") = Trim(Text9.Text)rs.Updaters.CloseMsgBox "添加信息成功!", vbExclamation + vbOKOnly, "提示"End SubPrivate Sub Form_Load()Dim cn As New ADODB.ConnectionDim cn_str As String, sql_str As Stringcn_str = "DRIVER=SQL SERVER;SERVER=QA2ONHYK7VWHRY2;DATABASE=library"cn.Open cn_strsql_str = "select * from 借阅信息表"rs.Open sql_str, cn_str, adOpenDynamic, adLockOptimisticText1.Text = rs(0)Text2.Text = rs(1)Text3.Text = rs(2)Text4.Text = rs(3)Text5.Text = rs(4)Text6.Text = rs(5)Text7.Text = rs(6)Text8.Text = rs(7)Text9.Text = rs(8)End Sub3.2.2.2图书借阅查询设计过程:选择图书借阅查询,在相应的栏目输入要查询的图书号就能查询该图书的借阅信息!设计代码:Private Sub Command1_Click()Dim cn As New ADODB.ConnectionDim rs As New ADODB.RecordsetDim flag As BooleanDim cn_str As String, sql_str As Stringcn_str = "DRIVER=SQL SERVER;SERVER=QA2ONHYK7VWHRY2;DATABASE=library"cn.Open cn_strsql_str = "select * from 借阅信息表"rs.Open sql_str, cnWhile Not rs.EOFIf Text10.Text = Trim(rs(0) ThenText1.Text = rs(0)Text2.Text = rs(1)Text3.Text = rs(2)Text4.Text = rs(3)Text5.Text = rs(4)Text6.Text = rs(5)Text7.Text = rs(6)Text8.Text = rs(7)Text9.Text = rs(8)flag = TrueExit SubElsers.MoveNextflag = FalseEnd IfWendIf flag = False ThenMsgBox "没有找到此图书的信息,请确认所输入正确的图书号!", vbCritical + vbOKOnly, "错误"rs.CloseEnd IfEnd SubPrivate Sub Command2_Click()Unload MeEnd Sub3.2.3读者信息管理 3.2.3.1添加删除修改读者信息 设计过程:选择添加删除修改读者信息,在相应的栏目填入或选择相应的内容,点击相应的按钮可以实现添加删除修改读者信息。设计代码:Dim rs As New ADODB.RecordsetPrivate Sub Command1_Click()rs.Deleters.AddNewrs("读者编号") = Trim(Text1.Text)rs("读者姓名") = Trim(Text2.Text)rs("性别") = Trim(Text3.Text)rs("出生日期") = Trim(Text4.Text)rs("单位") = Trim(Text5.Text)rs("家庭住址") = Trim(Text6.Text)rs("电话") = Trim(Text7.Text)rs("Email") = Trim(Text8.Text)rs("证件类型") = Trim(Text9.Text)rs("证件号码") = Trim(Text10.Text)rs("登记日期") = Trim(Text11.Text)rs("读者级别") = Trim(Text12.Text)rs.UpdateMsgBox "修改信息成功!", vbExclamation + vbOKOnly, "提示"End SubPrivate Sub Command2_Click()rs.DeleteMsgBox "删除成功!", vbExclamation + vbOKOnly, "提示"End SubPrivate Sub Command3_Click(Index As Integer)Select Case IndexCase 0rs.MoveFirstCase 1rs.MovePreviousIf rs.BOF Thenrs.MoveFirstMsgBox "已经是第一条记录", vbExclamation, "提示"End IfCase 2rs.MoveNextIf rs.EOF Thenrs.MoveLastMsgBox "已经是最后一条记录!", vbExclamation, "提示"End IfCase 3rs.MoveLastEnd SelectText1.Text = rs(0)Text2.Text = rs(1)Text3.Text = rs(2)Text4.Text = rs(3)Text5.Text = rs(4)Text6.Text = rs(5)Text7.Text = rs(6)Text8.Text = rs(7)Text9.Text = rs(8)Text10.Text = rs(9)Text11.Text = rs(10)Text12.Text = rs(11)End SubPrivate Sub Command4_Click()If Text1.Text = "" ThenMsgBox "请输入要添加的读者编号!", vbOKOnly + vbExclamation, "警告"Text1.SetFocusExit SubEnd IfIf Text2.Text = "" ThenMsgBox "请输入要添加的读者姓名!", vbOKOnly + vbExclamation, "警告"Text2.SetFocusExit SubEnd IfIf Text3.Text = "" ThenMsgBox "请输入要添加的性别!", vbOKOnly + vbExclamation, "警告"Text3.SetFocusExit SubEnd IfIf Text4.Text = "" ThenMsgBox "请输入出生日期!", vbOKOnly + vbExclamation, "警告"Text4.SetFocusExit SubEnd IfIf Text5.Text = "" ThenMsgBox "请输入单位!", vbOKOnly + vbExclamation, "警告"Text5.SetFocusExit SubEnd IfIf Text6.Text = "" ThenMsgBox "请输入家庭住址!", vbOKOnly + vbExclamation, "警告"Text6.SetFocusExit SubEnd IfIf Text7.Text = "" ThenMsgBox "请输入要添加电话!", vbOKOnly + vb

    注意事项

    本文(vb+sql2000图书管理系统.doc)为本站会员(asd****56)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

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

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

    收起
    展开