文档介绍:Dim rno As String '保存读书者借书证号
Dim bno As String '保存图书编号
Dim sqltxt As String
Dim rs As '对应resder表
Dim bs As '对应book表
Dim bors As '对应borrow表
Private Sub Command1_Click()
rno = Trim(Text1(0).Text)
If rno = "" Then
MsgBox "借书证号不能为空,请输入", vbOKOnly, "信息提示"
Text1(0).SetFocus
Else
sqltxt = "select*from reader,depart,rlevel where ='" & rno & "'" & "and =" & "and ="
Set rs = exesql(sqltxt)
If Then
MsgBox "该读者未登记", vbOKOnly, "信息提示"
Text1(0).SetFocus
Else
= rs("姓名")
= rs("部门名称")
= rs("借书总数")
= rs("已借书数")
= Val(Label(9).Caption) - Val(Label(11).Caption)
If Val(Label(13)) > 0 Then
= True
Text1(1).SetFocus
Else
MsgBox "该读者已借满图书,不能再借!", , "信息提示"
End If
sqltxt = "select ,,,book.," & "," & "from borrow,book where ='" & rno & "'" & "and =.图书编号"
= adCmdText
= sqltxt
If Not Then
Set = Adodc1
= True
End If
End If
End If
End Sub
Private Sub Data1_Validate(Action As Integer, Save As Integer)
End Sub
Private Sub Command2_Click()
bno = Trim(Text(1).Text)
If bno = "" Then