【文章內容簡介】
瀏覽 sfield [圖書編碼] Case 員工信息瀏覽 sfield [工號] Case 圖書借閱情況瀏覽 sfield [圖書編碼]End SelectEnd SubPrivate Sub Option2_Click 選擇查詢的字段Select Case TabStrip1SelectedItem Case 圖書信息瀏覽 sfield [圖書名稱] Case 員工信息瀏覽 sfield [姓名] Case 圖書借閱情況瀏覽 sfield [工號]End SelectEnd SubPrivate Sub Option3_Click 選擇查詢的字段Select Case TabStrip1SelectedItem Case 圖書信息瀏覽 sfield [出版社]End SelectEnd SubPrivate Sub Option4_Click 選擇查詢的字段Select Case TabStrip1SelectedItem Case 圖書信息瀏覽 sfield [作者]End SelectEnd SubPrivate Sub Text2_Change Text1Text TimeEnd SubPrivate Sub TabStrip1_Click Call connect_dbSelect Case TabStrip1SelectedItem Case 圖書信息瀏覽 open_connection book 連接book表 tablename book Option1Caption 書號 Option2Caption 書名 Set DataGrid1DataSource rst Case 員工信息瀏覽 If privilege 1 Then 如果只是普通用戶無法查詢員工信息 frmMsgShow frmMsgerrorVisible True frmMsgText1Text 對不起您沒有查閱的權限 Exit Sub End If open_connection worker 連接worker表 Option1Caption 工號 Option2Caption 姓名 tablename worker Set DataGrid1DataSource rst Case 圖書借閱情況瀏覽 open_connection record 連接record表 Option1Caption 書號 Option2Caption 工號 tablename record Set DataGrid1DataSource rstEnd SelectEnd SubPrivate Sub Timer1_Timer Label3Caption NowEnd SubPrivate Sub xpcmdbutton1_Click Form4ShowEnd SubPrivate Sub xpcmdbutton12_Click Form6ShowEnd SubPrivate Sub xpcmdbutton13_Click frmAboutShowEnd SubPrivate Sub xpcmdbutton14_Click Unload MefrmLoginShowEnd SubPrivate Sub xpcmdbutton15_Click open_connection readertablename readerSet DataGrid1DataSource rstEnd SubPrivate Sub xpcmdbutton2_Click Form5ShowEnd SubPrivate Sub xpcmdbutton3_Click Form2ShowEnd SubPrivate Sub xpcmdbutton4_Click Form3ShowEnd SubPrivate Sub xpcmdbutton5_Click open_connection book tablename recordSet DataGrid1DataSource rstEnd SubPrivate Sub xpcmdbutton6_Click open_connection record tablename recordSet DataGrid1DataSource rstEnd SubPrivate Sub xpcmdbutton7_Click open_connection worker tablename workerSet DataGrid1DataSource rstEnd SubPrivate Sub xpcmdbutton8_Click Frm_sys_setShowEnd SubPrivate Sub xpmin_Click MeWindowState 1End SubPrivate Sub xpclose_Click Unload MefrmLoginShowEnd SubPrivate Sub xptopbuttons1_Click Unload MeEnd SubPrivate Sub xptopbuttons2_Click MeWindowState 1End Sub用戶登陸 該窗體主要完成用戶管理登陸功能也是進入系統(tǒng)的一個重要的門檻該門檻是有權限限制根據不同的用戶帳號功能也截然不同這就是本系統(tǒng)的一個關鍵點默然讀者帳號reader 密碼008代碼見code目錄下logintxtPrivate Sub Form_Load 連接用戶表Call open_connection user_table xpcmdbutton1Caption 登陸xpcmdbutton2Caption 注銷End SubPrivate Sub Image1_Click End SubPrivate Sub xpcmdbutton1_Click 登錄系統(tǒng)Dim sql As StringIf Trim Text1Text Then 如果文本框為空則給出提示 frmMsgShow frmMsgnoticeVisible True frmMsgText1Text 請輸入用戶登錄賬號 Exit SubElse sql select from user_table where [登錄名] Trim Text1Text 查找用戶登錄名 rstClose rstOpen sql con adOpenDynamic adLockOptimistic If rstRecordCount 0 Then frmMsgShow frmMsgerrorVisible True frmMsgText1Text 用戶名不存在 Exit Sub End If 用戶合法性檢測并賦予一定的權限級別 If LCase Trim rst[登錄名] LCase Trim Text1Text Then If Trim rst[密碼] Trim Text2Text Then privilege rst[權限] Call check_privage privilege 權限分配 Else frmMsgShow frmMsgerrorVisible True frmMsgText1Text 密碼錯誤請重新輸入 Exit Sub End If End IfEnd IfEnd SubPrivate Sub xpcmdbutton2_Click 退出系統(tǒng)EndEnd SubPrivate Sub xptopbuttons1_Click EndEnd SubPrivate Sub xptopbuttons2_Click Index As Integer MeWindowState 1End Sub如果用戶名錯誤或者密碼錯誤 友情提示窗體就會響應傳送信息給用戶提示1提示22借書 該窗體主要完成讀者借閱功能也是最重要的一項功能讀者借閱圖書與職工人員管理人員才能完成借閱功能借閱后系統(tǒng)信息將保存以便管理員能核對一下以免出錯假如你已經超過最大的借閱量系統(tǒng)還會自動提醒管理員該讀者已經不能繼續(xù)借書了該閱子模塊簡單計算機圖書綜合信息以圖書編號歸攏在一起方便借閱代碼見code目錄下 borrowtxt窗體代碼Option ExplicitPrivate Sub Command1_Click 借出圖書Dim sql sql1 sql2 As StringDim num As Integersql select from recordsql1 select from worker where [工號] sql2 select from book where [圖書編碼] Dim param1 param2 param3 param4 As ADODBParameterDim cmd1 cmd2 cmd3 cmd4 As ADODBCommandSet cmd1 New ADODBCommandSet cmd2 New ADODBCommandSet cmd3 New ADODBCommandSet cmd4 New ADODBCommandS