图书管理系统程序源代码(共23页).doc





《图书管理系统程序源代码(共23页).doc》由会员分享,可在线阅读,更多相关《图书管理系统程序源代码(共23页).doc(23页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上源程序1. 主窗体Private Sub add_back_Click()frmbackbookinfo.ShowEnd SubPrivate Sub add_binf_Click()frmaddbookinfo.ShowEnd SubPrivate Sub add_book_style_Click()frmaddbookstyle.ShowEnd SubPrivate Sub add_manager_Click()frmadduser.ShowEnd SubPrivate Sub add_rinf_Click()frmaddreaderinfo.ShowEnd Su
2、bPrivate Sub add_rstyle_Click()frmaddreaderstyle.ShowEnd SubPrivate Sub change_binf_Click()frmmodifybookinfo.ShowEnd SubPrivate Sub change_book_style_Click()frmmodifybookstyle.ShowEnd SubPrivate Sub delete_binf_Click()frmmodifybookinfo.ShowEnd SubPrivate Sub delete_book_style_Click()frmmodifybooksty
3、le.ShowEnd SubPrivate Sub delete_rstyle_Click()frmmodifyreaderstyle.ShowEnd SubPrivate Sub exit_Click()EndEnd SubPrivate Sub find_binf_Click()frmfindbook.ShowEnd SubPrivate Sub find_lend_Click()frmfindborrowinfo.ShowEnd SubPrivate Sub find_rinf_Click()frmfindreader.ShowEnd SubPrivate Sub password_Cl
4、ick()frmchangepwd.ShowEnd Sub2. LoginOption ExplicitPrivate Sub cmdOK_Click()Dim strUserName As StringDim strPassword As StringDim strTargetAsp As StringDim conn As ADODB.ConnectionDim rsLogin As ADODB.RecordsetDim strSQL As StringIf Trim(txtUserName.Text) = Then MsgBox “用户名”不能为空! Exit SubElse strUs
5、erName = Trim(txtUserName.Text)End IfIf Trim(txtPassword.Text) = Then MsgBox “口令”不能为空! Exit SubElse strPassword = Trim(txtPassword.Text)End If检查口令、用户身份Set conn = New ADODB.Connectionconn.Provider = Microsoft.jet.OLEDB.4.0conn.ConnectionString = D:图书管理系统book.mdbconn.OpenstrUserName = Replace(strUserN
6、ame, , “)strSQL = select*from 系统管理 where 用户名= & strUserName & and 密码= & strPassword & Set rsLogin = conn.Execute(strSQL)If rsLogin.EOF Or rsLogin.BOF ThenMsgBox 用户名或口令错误,请检查!txtPassword.SelStart = 0txtPassword.SelLength = Len(txtPassword.Text)txtPassword.SetFocusElseSelect Case rsLogin(权限) Case 领导 s
7、trTargetAsp = LeadersMain.asp Case 主任 strTargetAsp = ZhuRenMain.asp Case 秘书 strTargetAsp = MishuMain.aspCase 图书管理员 strTargetAsp = TuShuManagerMain.aspCase Else strTargetAsp = OtherMain.asp End Select SaveSetting JGYOA, Login, UserName, strUserName Hyperlink.NavigateTo HTTP:/ & /oa/ & strTargetAspEnd
8、 If释放变量Set rsLogin = NothingSet conn = NothingEnd Sub3. frmaddbookinfoPrivate Sub Command1_Click()Dim rs_addbook As New ADODB.RecordsetDim sql As StringIf Trim(Combo1.Text) = Then MsgBox 请选择图书种类, vbOKOnly + vbExclamation, Combo1.SetFocus Exit SubEnd IfIf Trim(Text1.Text) = Then MsgBox 图书编号不能为空, vbOK
9、Only + vbExclamation, Text1.SetFocus Exit SubEnd IfIf Trim(Text2.Text) = Then MsgBox 书名不能为空, vbOKOnly + vbExclamation, Text2.SetFocus Exit SubEnd If If Not IsDate(Text5.Text) Then MsgBox 请按照yyy-mm-dd格式输入日期, vbOKOnly + vbExclamation, Text5.SetFocus Exit SubEnd If If Not IsDate(Text6.Text) Then MsgBox
10、 请按照yyy-mm-dd格式输入日期, vbOKOnly + vbExclamation, Text6.SetFocus Exit SubEnd If sql = select * from 书籍信息 where 书籍编号= & Text1.Text & rs_addbook.Open sql, conn, adOpenKeyset, adLockPessimisticIf rs_addbook.EOF Then rs_addbook.AddNew rs_addbook.Fields(0) = Trim(Text1.Text) rs_addbook.Fields(1) = Trim(Text
11、2.Text)rs_addbook.Fields(2) = Trim(Combo1.Text)rs_addbook.Fields(3) = Trim(Text3.Text)rs_addbook.Fields(4) = Trim(Text4.Text)rs_addbook.Fields(5) = Trim(Text5.Text)rs_addbook.Fields(6) = Trim(Text6.Text)rs_addbook.Fields(7) = 否rs_addbook.UpdateMsgBox 添加图书信息成功!, vbOKOnly, rs_addbook.CloseElse MsgBox
12、图书编号重复!, vbOKOnly + vbExclamation, Text1.SetFocus Text1.Text = rs_addbook.Close Exit SubEnd IfEnd SubPrivate Sub Command2_Click()Unload MeEnd SubPrivate Sub Form_Load()Dim rs_leibie As New ADODB.RecordsetDim sql As Stringsql = select * from 图书类别rs_leibie.Open sql, conn, adOpenKeyset, adLockPessimist
13、icrs_leibie.MoveFirstDo While Not rs_leibie.EOF Combo1.AddItem rs_leibie.Fields(0) rs_leibie.MoveNextLooprs_leibie.CloseEnd Sub4. frmaddbookstylePrivate Sub Command1_Click()Dim rs_bookstyle As New ADODB.RecordsetDim sql As StringIf Trim(Text1.Text) = Then MsgBox 图书种类不能为空, vbOKOnly + vbExclamation, T
14、ext1.SetFocus Exit SubEnd IfIf Trim(Text2.Text) = Then MsgBox 种类编号不能为空, vbOKOnly + vbExclamation, Text2.SetFocus Exit SubEnd Ifsql = select * from 图书类别 where 类别名称= & Text1.Text & rs_bookstyle.Open sql, conn, adOpenKeyset, adLockOptimisticIf rs_bookstyle.EOF Then rs_bookstyle.AddNewrs_bookstyle.Field
15、s(0) = Trim(Text1.Text)rs_bookstyle.Fields(1) = Trim(Text2.Text)rs_bookstyle.UpdateMsgBox 添加图书类别成功!, vbOKOnly, rs_bookstyle.CloseElseMsgBox 读者类别重复!, vbOKOnly + vbExclamation, Text1.SetFocusText1.Text = rs_bookstyle.CloseExit SubEnd IfEnd SubPrivate Sub Command2_Click()Unload MeEnd Sub5. frmaddreader
16、infoOption ExplicitDim rs_addreader As New ADODB.RecordsetPrivate Sub Command1_Click()Dim sql As StringIf Trim(Combo1.Text) = Then MsgBox 请选择读者种类, vbOKOnly + vbExclamation, Combo1.SetFocus Exit SubEnd IfIf Trim(Text2.Text) = Then MsgBox 读者姓名不能为空, vbOKOnly + vbExclamation, Text1.SetFocus Exit SubEnd
17、IfIf Trim(Text3.Text) = Then MsgBox 读者编号不能为空, vbOKOnly + vbExclamation, Text2.SetFocus Exit SubEnd Ifsql = select * from 读者信息 where 读者编号= & Text2.Text & rs_addreader.Open sql, conn, adOpenKeyset, adLockPessimisticIf rs_addreader.EOF Then rs_addreader.AddNew rs_addreader.Fields(0) = Trim(Text2.Text)
18、rs_addreader.Fields(1) = Trim(Text3.Text)rs_addreader.Fields(2) = Trim(Combo2.Text)rs_addreader.Fields(3) = Trim(Combo1.Text)rs_addreader.Fields(4) = Trim(Text5.Text)rs_addreader.Fields(5) = Trim(Text6.Text)rs_addreader.Fields(6) = Trim(Text4.Text)rs_addreader.Fields(7) = CDate(Text1.Text)rs_addread
19、er.UpdateMsgBox 添加读者信息成功!, vbOKOnly, rs_addreader.CloseElse MsgBox 读者编号重复!, vbOKOnly + vbExclamation, Text1.SetFocus Text1.Text = rs_addreader.Close Exit SubEnd IfEnd SubPrivate Sub Command2_Click()Unload MeEnd SubPrivate Sub Form_Load()Combo2.AddItem 男Combo2.AddItem 女Dim rs_leibie As New ADODB.Reco
20、rdsetDim sql As Stringsql = select * from 读者类别rs_leibie.Open sql, conn, adOpenKeyset, adLockPessimisticrs_leibie.MoveFirstDo While Not rs_leibie.EOF Combo1.AddItem rs_leibie.Fields(0) rs_leibie.MoveNextLooprs_leibie.CloseEnd Sub6. frmaddreaderstyleOption ExplicitDim rs_readerstyle As New ADODB.Recor
21、dsetPrivate Sub Command1_Click()Dim sql As StringIf Trim(Text1.Text) = Then MsgBox 读者种类不能为空!, vbOKOnly + vbExclamation, Text1.SetFocus Exit SubEnd IfIf Trim(Text2.Text) = Then MsgBox 借书数量不能为空!, vbOKOnly + vbExclamation, Text2.SetFocus Exit SubEnd IfIf Trim(Text3.Text) = Then MsgBox 借书期限不能为空!, vbOKOn
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 图书 管理 系统 程序 源代码 23

限制150内