1源程序清单1、文件名login(login.frm)功能说明:整个系统的登陆界面,需要输入用户名和登陆密码才能进入到系统中,进行借阅等操作。源代码:OptionExplicitDimcntAsIntegerPrivateSubCommand1_Click()DimsqlAsStringDimrs_loginAsNewADODB.RecordsetIfTrim(Combo1.Text)=ThenMsgBox没有这个用户,vbOKOnly+vbExclamation,Combo1.SetFocusElsesql=select*from系统管理where用户名='&Combo1.Text&'rs_login.Opensql,conn,adOpenKeyset,adLockPessimisticIfrs_login.EOF=TrueThenMsgBox没有这个用户,vbOKOnly+vbExclamation,Combo1.SetFocusElseIfTrim(rs_login.Fields(1))=Trim(txtpwd.Text)ThenuserID=Combo1.Textrs_login.CloseUnloadMeform1.ShowElseMsgBox密码不正确,vbOKOnly+vbExclamation,txtpwd.SetFocusEndIf2EndIfEndIfcnt=cnt+1Ifcnt=3ThenUnloadMeEndIfExitSubEndSubPrivateSubCommand2_Click()UnloadMeEndSubPrivateSubForm_Load()DimconnectionstringAsStringconnectionstring=provider=Microsoft.Jet.oledb.4.0;&_datasource=book.mdbconn.Openconnectionstringcnt=0EndSubPrivateSubtxtuser_Change()EndSub2、文件名form1(form1.frm)功能说明:整个系统的主界面,其中包括图书管理、读者管理、图书借阅管理、系统管理、关于,以及在这下面的子菜单。源代码:PrivateSubadd_admin_Click()frmadduser.ShowEndSubPrivateSubadd_back_book_Click()frmbackbookinfo.Show3EndSubPrivateSubadd_book_info_Click()frmaddbookinfo.ShowEndSubPrivateSubadd_book_style_Click()frmaddbookstyle.ShowEndSubPrivateSubadd_lend_book_Click()frmfindbook.ShowEndSubPrivateSubadd_reader_info_Click()frmaddreaderinfo.ShowEndSubPrivateSubadd_reader_style_Click()frmaddreaderstyle.ShowEndSubPrivateSubchange_pwd_Click()frmchangepwd.ShowEndSubPrivateSubdel_book_info_Click()frmmodifybookinfo.ShowEndSubPrivateSubdel_book_style_Click()frmmodifybookstyle.ShowEndSubPrivateSubdel_reader_info_Click()frmreaderinfo.ShowEndSubPrivateSubdel_reader_style_Click()4frmmodifyreaderstyle.ShowEndSubPrivateSubexit_sys_Click()EndEndSubPrivateSubfind_book_info_Click()frmfindbook.ShowEndSubPrivateSubfind_lend_book_Click()frmfindborrowinfo.ShowEndSubPrivateSubfind_reader_info_Click()frmfindreader.ShowEndSubPrivateSubForm_Load()EndSubPrivateSubgly_Click()Form2.ShowEndSubPrivateSubmodify_book_info_Click()frmmodifybookinfo.ShowEndSubPrivateSubmodify_book_style_Click()frmmodifybookstyle.ShowEndSubPrivateSubmodify_reader_info_Click()frmreaderinfo.ShowEndSubPrivateSubmodify_reader_style_Click()5frmmodifyreaderstyle.ShowEndSub3、文件名frmaddbookstyle(frmbookstyle.frm)功能说明:用于添加图书类别信息。源代码:OptionExplicitPrivateSubCommand1_Click()Dimrs_bookstyleAsNewADODB.RecordsetDimsqlAsStringIfTrim(Text1.Text)=ThenMsgBox图书种类不能为空,vbOKOnly+vbExclamation,Text1.SetFocusExitSubEndIfIfTrim(Text2.Text)=ThenMsgBox种类编号不能为空,vbOKOnly+vbExclamation,Text2.SetFocusExitSubEndIfsql=select*from图书类别where类别名称='&Text1.Text&'rs_bookstyle.Opensql,conn,adOpenKeyset,adLockPessimisticIfrs_bookstyle.EOFThenrs_bookstyle.AddNewrs_bookstyle.Fields(0)=Trim(Text1.Text)rs_bookstyle.Fields(1)=Trim(Text2.Text)rs_bookstyle.UpdateMsgBox添加图书类别成功!,vbOKOnly,rs_bookstyle.CloseElse6MsgBox读者类别重复!,vbOKOnly+vbExclamation,Text1.SetFocusText1.Text=rs_bookstyle.CloseExitSubEndIfEndSubPrivateSubCommand2_Click()UnloadMeEndSub4、文件名frmmodifybookstyle(code)功能说明:图书类别管理,可以修改和删除图书类别。源代码:OptionExplicitDimrs_readerAsNewADODB.RecordsetPrivateSubcmdcancel_Click()rs_reader.CancelUpdateDataGrid1.RefreshDataGrid1.AllowAddNew=FalseDataGrid1.AllowUpdate=Falsecmdmodify.Enabled=Truecmddel.Enabled=Truecmdcancel.Enabled=Falsecmdupdate.Enabled=FalseEndSubPrivateSubcmddel_Click()DimanswerAsStringOnErrorGoTodelerroranswer=MsgBox(确定要删除吗?,vbYesNo,)7Ifanswer=vbYesThenDataGrid1.AllowDelete=Truers_reader.Deleters_reader.UpdateDataGrid1.RefreshMsgBox成功删除!,vbOKOnly+vbExclamation,DataGrid1.AllowDelete=FalseElseExitSubEndIfdelerror:IfErr.Number0ThenMsgBoxErr.DescriptionEndIfEndSubPrivateSubcmdmodify_Click()DimanswerAsStringOnErrorGoTocmdmodifycmddel.Enabled=Falsecmdmodify.Enabled=Falsecmdupdate.Enabled=Truecmdcancel.Enabled=TrueDataGrid1.AllowUpdate=Truecmdmodify:IfErr.Number0ThenMsgBoxErr.DescriptionEndIfEndSubPrivateSubCommand5_Click()8rs_reader.UpdateDataGrid1.RefreshEndSubPrivateSubcmdupdate_Click()IfNotIsNull(DataGrid1.Bookmark)Thenrs_reader.UpdateEndIfcmdmodify.Enabled=Truecmddel.Enabled=Truecmdcancel.Enabled=Falsecmdupdate.Enabled=FalseDataGrid1.AllowUpdate=FalseMsgBox保存成功!,vbOKOnly+vbExclamation,EndSubPrivateSubCommand1_Click()UnloadMeEndSubPrivateSubForm_Load()DimsqlAsStringOnErrorGoToloaderrorsql=select*from图书类别rs_reader.CursorLocation=adUseClientrs_reader.Opensql,conn,adOpenKeyset,adLockPessimistic'打开数据库cmdupdate.Enabled=False'设定datagrid控件属性DataGrid1.AllowAddNew=False'不可增加9DataGrid1.AllowDelete=False'不可删除DataGrid1.AllowUpdate=FalseIfuserpow=guestThen'权限相关Frame2.Enabled=FalseEndIfSetDataGrid1.DataSource=rs_readerExitSubloaderror:MsgBoxErr.DescriptionEndSub5、文件名frmaddbookinfo(frmaddbookinfo.frm)功能说明:添加图书信息,包括图书编号、书名、出版日期、入库日期、作者等信息。源代码:OptionExplicitPrivateSubCommand1_Click()Dimrs_addbookAsNewADODB.RecordsetDimsqlAsStringIfTrim(Combo1.Text)=ThenMsgBox请选择图书种类,vbOKOnly+vbExclamation,Combo1.SetFocusExitSubEndIfIfTrim(Text1.Text)=ThenMsgBox图书编号不能为空,vbOKOnly+vbExclamation,Text1.SetFocusExitSub10EndIfIfTrim(Text2.Text)=ThenMsgBox书名不能为空,vbOKOnly+vbExclamation,Text2.SetFocusExitSubEndIfIfNotIsDate(Text5.