= False
MsgBox \修改成功\恭喜成功\ End If = 1550 = \高级\ = True End Sub
Private Sub Cmdxg_Click() Dim Srl As String On Error GoTo xg = False = False = True = True = True xg:
If <> 0 Then MsgBox End If End Sub
Private Sub Form_Unload(Cancel As Integer) Set = Nothing End Sub
2.5.4添加读者类别界面: Private Sub Command1_Click() Dim Srl As String Dim Mybook As New If Trim = \
MsgBox \读者类别名称不能为空\注意\
Exit Sub End If
If Trim = \
MsgBox \借书数量不能为空\注意\ Exit Sub End If
If Trim = \
MsgBox \借书期限不能为空\注意\ Exit Sub End If
If Trim = \
MsgBox \有效期限不能为空\注意\ Exit Sub End If
On Error GoTo Cw
Srl = \读者类别名称='\ Srl, Sjk, adOpenKeyset, adLockPessimistic If Then
(0) = Trim (1) = Trim (2) = Trim (3) = Trim
MsgBox \您已经成功添加\这一读者类别 \添加成功!\ Else
MsgBox \读者类别名称为\重复\注意重复\
= \ Exit Sub End If Cw: MsgBox End Sub
Private Sub Command2_Click() Unload Me
End Sub
Private Sub Form_Load()
Dim Sq1 As String '定义一个字符串变量 Dim Myjl As New '定义一个Recordset对象变量 End Sub
2.5.5查询读者信息代码: Private Sub Form_Load()
Dim Sq1 As String '定义一个字符串变量 Dim Myjl As New '定义一个Recordset对象变量 Sq1 = \
Sq1, Sjk, adOpenKeyset, adLockPessimistic Do While Not (0) Loop = 0 End Sub
Private Sub Command1_Click()
Dim Srl As String '定义一个字符串变量
Dim Mybook As New '定义一个Recordset对象变量 If = vbChecked Then
Srl = \读者编号='\ End If
If = vbChecked Then If Trim(Srl) = \
Srl = \读者姓名='\ Else
Srl = Srl & \读者编号='\ End If End If
If = vbChecked Then If Trim(Srl) = \
Srl = \读者类别='\ Else
Srl = Srl & \读者类别='\ End If End If
If Srl = \
MsgBox \请选择一种查询依据\查询方式\ Exit Sub End If
Srl = \ = adUseClient
Srl, Sjk, adOpenKeyset, adLockPessimistic = False = False = False Set = Mybook
End Sub
Private Sub Command2_Click() Unload Me End Sub
2.5.6图书借阅管理模块代码: 2.5.6.1查询书籍窗体代码
Private Sub Form_Load()’窗体加载时就书籍类别加载到列表框中。 Dim Sq1 As String '定义一个字符串变量 Dim Myjl As New '定义一个Recordset对象变量 Sq1 = \
Sq1, Sjk, adOpenKeyset, adLockPessimistic Do While Not (1) Loop = 0 End Sub
Private Sub Command1_Click()’查询命令按钮代码 Dim Srl As String '定义一个字符串变量
Dim Mybook As New '定义一个Recordset对象变量
If = vbChecked Then
Srl = \书籍名称='\ End If
If = vbChecked Then If Trim(Srl) = \
Srl = \图书编号='\ Else
Srl = Srl & \图书编号='\
用VB编写一个简单的图书管理系统
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)