【正文】
rom booktran where BorrowDate LIKE39。 amp。If QueryData(strF) Then Set = rstEnd IfEnd IfIf = 圖書編號 Then strF = select * from booktran where bookid like 39。 amp。If QueryData(strF) Then Set = rstEnd IfEnd IfEnd SubPrivate Sub Form_Load() = 編號 名字 城市If CnToDB = False Then MsgBox 網(wǎng)絡(luò)未響應(yīng)!出現(xiàn)此情況可能是與服務(wù)器沒有物理連接或數(shù)據(jù)庫不在指向的服務(wù)器上!, vbCritical + vbOKOnly, Connecting ErrorEnd IfOn Error GoTo fmerr If QueryData(select * from reader) = True Then Set = rst Else MsgBox 查詢失??! End If Exit Subfmerr: If = True And = True Then MsgBox 沒有任何記錄! End IfEnd Sub當(dāng)單擊記錄瀏覽-借閱記錄菜單時,窗體如下代碼如下:Private Sub Command1_Click()Dim strF As StringIf = 讀者編號 Then strF = select * from booktran where readerid like 39。 amp。If QueryData(strF) Then Set = rstEnd IfEnd IfIf = 城市 Then strF = select * from reader where readercity like 39。 amp。If QueryData(strF) Then Set = rstEnd IfEnd IfIf = 名字 Then strF = select * from reader where readername like 39。 amp。 If QueryData(strF1) Then = (readername).Value = (readerage).Value = (readercity).Value = ().Value End IfEnd SubPrivate Sub Form_Load()txtClsEnd SubPrivate Sub txtCls() = = = = = End SubPrivate Sub showDB() = (0).Value = (1).Value = (2).Value = (3).Value = (4).Value End Sub當(dāng)單擊記錄瀏覽-讀者記錄菜單時,窗體如下代碼如下:Private Sub Command1_Click()Dim strF As StringIf = 編號 Then strF = select * from reader where readerid like 39。 amp。If QueryData(strF) Then = (bookname).Value = (booktype).Value = (bookprice).Value = (bookstate).Value = (bookpublish).Value = (bookintime).ValueEnd IfEnd SubPrivate Sub Form_Load() Call txtClsEnd SubPrivate Sub upD2() (0).Value = (1).Value = (2).Value = (3).Value = (4).Value = (5).Value = (6).Value = End SubPrivate Sub txtCls() = = = = = = = End SubPrivate Sub showDB() = (0).Value = (1).Value = (2).Value = (3).Value = (4).Value = (5).Value = (6).ValueEnd Sub當(dāng)單擊數(shù)據(jù)管理-刪除-刪除讀者菜單時,窗體如下代碼如下:Private Sub Command1_Click()Unload MeEnd SubPrivate Sub Command2_Click() If = True And = True Then MsgBox 沒有數(shù)據(jù)! Else If Or Then MsgBox 沒有數(shù)據(jù) Call txtCls End If Call showDB End IfEnd SubPrivate Sub Command3_Click()Unload MeEnd SubPrivate Sub Command5_Click()Dim strF1 As String strF1 = select * from reader where readerid like 39。 amp。 If QueryData(strF1) Then = (readername).Value = (readerage).Value = (readercity).Value = ().Value End IfEnd SubPrivate Sub Form_Load() = = = = = End SubPrivate Sub upD3() (0).Value = (1).Value = (2).Value = (3).Value = (4).Value = End Sub當(dāng)單擊數(shù)據(jù)管理-刪除-刪除書籍菜單時,窗體如下代碼如下:Private Sub Command1_Click()Unload MeEnd SubPrivate Sub Command2_Click()On Error GoTo no Call upD2 If Or Then First End If Exit Subno: MsgBox 修改成功End SubPrivate Sub Command4_Click() If = True And = True Then MsgBox 沒有數(shù)據(jù)! Else If Or Then MsgBox 沒有數(shù)據(jù) Call txtCls End If Call showDB End IfEnd SubPrivate Sub Command5_Click()Dim strF As String strF = select * from book where bookid like 39。 amp。If QueryData(strF) Then = (bookname).Value = (booktype).Value = (bookprice).Value = (bookstate).Value = (bookpublish).Value = (bookintime).Value End IfEnd SubPrivate Sub Form_Load() = = = = = = = End SubPrivate Sub upD2() (0).Value = (1).Value = (2).Value =