【正文】
Else MsgBox 沒有該讀者信息! , vbOKOnly, 提示! = End If End IfEnd Sub(2) 利用Text的LostFocus事件來觸發(fā)查詢借閱信息。 amp。Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then = select * from dzxxtb where 讀者編號=39。.(2)。, n, adOpenKeyset, adLockOptimistic If 0 Then = (讀者姓名) = (性別) = (出生日期) = (單位) = (家庭住址) = (家庭電話) = (手機(jī)號碼) = (傳真號碼) = (Email) = (證件類型) = (證件號碼) = (登記日期) = (讀者級別) = (備注) Else MsgBox 該讀者編號不正確!, vbCritical, 提示! = Exit Sub End If End IfEnd Sub 借書管理模塊借書管理模塊主要功能是將讀者的借書信息保存到數(shù)據(jù)庫中,并可以對讀者的借書信息進(jìn)行刪除等操作。Private Sub Text15_KeyDown(KeyCode As Integer, Shif As Integer) If KeyCode = vbKeyReturn Then Dim rs As New select * from dzxxtb where 讀者編號 =39。 Chr(35) amp。 Chr(35) amp。 Chr(35) amp。 Chr(35) amp。 + + 39。 Combo6 amp。 ) Else = select * from dzxxtb where ( amp。 amp。 and amp。 amp。 and 登記日期 between amp。 like 39。 End If If = 1 And = 1 Then If = like Then = select * from dzxxtb where( amp。 amp。 and amp。 amp。 End If End If If = 0 And = 1 Then = select * from dzxxtb where 登記日期 between amp。 + 39。 amp。% + + %39。 amp。) (sql) MsgBox 數(shù)據(jù)保存成功, 64, 提示! = select * from dzxxtb clear1 End IfEnd Sub(3) 根據(jù)不同選擇按不同方式查詢讀者信息。 Text9 amp。,39。 Text6 amp。,39。 DTPicker1 amp。,39。 Text13 amp。,39。 Combo2 amp。,39。 Text4 amp。,39。 Text12 amp。,39。 Text8 amp。,39。 Text3 amp。,39。 Text11 amp。,39。 Text7 amp。,39。 DTPicker2 amp。,39。 Combo1 amp。,39。 Text5 amp。,39。 Text1 amp。Private Sub Command3_Click() Dim sql As String If = Or = Or = Or = Or = Or _ = Or = Or = Or = Or = Or = Then MsgBox 請輸入完整的讀者信息!, vbOKOnly, 提示! Else sql = insert into dzxxtb values(39。(1) 添加讀者時自動生成讀者編號。查詢選項卡中根據(jù)是否選擇Like運算符,來按不同的查詢語法規(guī)則進(jìn)行查詢。添加選項卡中,利用ADO執(zhí)行SQL語句查詢數(shù)據(jù)庫中的讀者編號,然后根據(jù)最后一個讀者的編號自動生產(chǎn)新的讀者編號。.(1)。 On Error Resume Next pl = If pl 1000 Then pl = 1000 = pl End If If pl ( 1000) Then pl = 1000 = pl End If = pl 5 = pl 5 = 100 = + 100 = 10 = RGB(155, 106, 161)End Sub(5) 通過時間控件在狀態(tài)欄顯示當(dāng)前系統(tǒng)時間。Private Sub Lbl_Pic_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single) Lbl_info(Index).ForeColor = RGB(255, 0, 0) End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) Dim i As Integer For i = 0 To 1 Lbl_info(i).ForeColor = RGB(0, 0, 0) Next iEnd Sub(4) 利用圖片框?qū)崿F(xiàn)窗體分隔條,可以利用鼠標(biāo)點擊拖動來實現(xiàn)框體大小的改變。 + (主菜單名稱) + 39。主要代碼:(1) 定義Tree_Change過程。在程序運行時,當(dāng)單擊TreeView控件中的節(jié)點時,通過TreeView控件的NodeClick事件將該節(jié)點下的子菜單顯示在ListView控件中。在窗體加載的時候調(diào)用自定義的過程Tree_Change,向TreeView控件中添加菜單信息,這里主要應(yīng)用的就是TreeView控件中的Node對象的Add方法。.(1)。Presist Security Info=False” End Function主窗體用于調(diào)用程序的所有功能,該主窗體主要有菜單欄,帶圖片的工具欄、左側(cè)的樹狀導(dǎo)航菜單、右側(cè)的功能列表以及底部的狀態(tài)欄組成。 amp。模塊中連接數(shù)據(jù)庫的程序代碼如下: Function n()As ADODB Connection Set n = New 實例化對象 執(zhí)行數(shù)據(jù)庫連接 “Provider=。這樣,如果使用對象操作數(shù)據(jù)庫,就可以直接調(diào)用數(shù)據(jù)庫連接n函數(shù)。在系統(tǒng)中,將數(shù)據(jù)庫連接的通用代碼以及公共全局變量等都集