【正文】
+ + 39。更新 Adodc1 End Sub (4) 刪除某條記錄。借 39。 39。 amp。where 條碼號(hào) =39。 y amp。,借書數(shù)量=39。 x amp。計(jì)算已經(jīng)借出數(shù) hs1 = update books set 復(fù)本數(shù) =39。)) x = Val((復(fù)本數(shù) )) Val() 39。,39。 DTPicker2 amp。,39。 DTPicker1 amp。,39。 Text10 amp。,39。 Text6 amp。,39。 Text9 amp。,39。 Text5 amp。,39。 Text8 amp。,39。 Text4 amp。,39。 Text7 amp。,39。 Text3 amp。,39。 Text2 amp。,39。 Text1 amp。 If 0 Then (insert into dzjstb values(39。, n, adOpenKeyset, adLockOptimistic = select * from sz If (0) + Val() (0) Then MsgBox 您的借書量已滿??! , vbOKOnly, 提示! Exit Sub Else = select * from books where 條碼號(hào) =39。 Private Sub Command1_Click() Dim x, y As Integer Dim hs1 If = Or = Or = Or = Or = Then MsgBox 輸入的借書信息不完全! , vbCritical, 提示! Else select sum(借書數(shù)量 ) from dzjstb where 讀者編號(hào)=39。 39。 amp。 If 0 Then = (1) Else MsgBox 沒有該讀者信息! , vbOKOnly, 提示! = End If End If End Sub (2) 利用 Text 的 LostFocus 事件來觸發(fā)查詢借閱信息。 amp。 Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then = select * from dzxxtb where 讀者編號(hào) =39。 如圖 .(2)。, n, adOpenKeyset, adLockOptimistic If 0 Then = (讀者姓名 ) = (性別 ) = (出生日期 ) = (單位 ) = (家庭住址 ) = (家庭電話 ) = (手機(jī)號(hào)碼 ) = (傳真號(hào)碼 ) = (Email) = (證件類型 ) = (證件號(hào)碼 ) = (登記日期 ) = (讀者級(jí)別 ) = (備注 ) Else MsgBox 該讀者編號(hào)不正確! , vbCritical, 提示! = Exit Sub End If End If End Sub 借書管理模塊 借書管理模塊主要功能是將讀者的借書信息保存到數(shù)據(jù)庫中, 并可以對(duì)讀者的借書信息進(jìn)行刪除等操作。 Private Sub Text15_KeyDown(KeyCode As Integer, Shif As Integer) If KeyCode = vbKeyReturn Then Dim rs As New select * from dzxxtb where 讀者編號(hào) =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 If End Sub 圖書管理系統(tǒng) (Visual Basic + Access ) 19 / 95 (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