花姑子水三娘喜欢谁:还是那断代码下一断也帮我解释

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 15:36:26
If Checkbox(2) Then
If Trim(QueryTermAuthor.Text) = "" Then
MsgBox "图书作者不能为空!", vbOKOnly + vbExclamation, "警告"
QueryTermAuthor.SetFocus
Exit Sub
Else
bf(2) = True
If bf(0) Or bf(1) Then
'组合查询语句
sql = sql & "and bookOrigAuthor='" & Trim(QueryTermAuthor.Text) & "'"
Else
sql = sql & " bookOrigAuthor='" & Trim(QueryTermAuthor.Text) & "'"
End If
End If
End If
'判断是否设置出版社查询方式
If Checkbox(3) Then
If Trim(QueryTermPress.Text) = "" Then
MsgBox "出版社信息不能为空!", vbOKOnly + vbExclamation, "警告"
QueryTermPress.SetFocus
Exit Sub
Else
bf(3) = True
If bf(0) Or bf(1) Or bf(2) Then
'组和查询语句
sql = sql & "and bookpress = '" & Trim(QueryTermPress.Text) & "'"
Else
sql = sql & " bookpress = '" & Trim(QueryTermPress.Text) & "'"
End If
End If
End If

'判断是否设置查询方式
If Not (bf(0) Or bf(1) Or bf(2) Or bf(3)) Then
MsgBox "请设置查询方式!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If

'查询所有满足条件的内容
sql = sql & " order by bookno"
Set rs = TransactSQL(sql)
If rs.EOF = True Then
MsgBox "没有找到要查询的信息", vbOKOnly
Else
With bookQueryGrid
.Rows = 1
Do While Not rs.EOF
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = rs.Fields(0)
.TextMatrix(.Rows - 1, 1) = rs.Fields(1)
.TextMatrix(.Rows - 1, 2) = rs.Fields(2)
.TextMatrix(.Rows - 1, 3) = rs.Fields(3)
.TextMatrix(.Rows - 1, 4) = rs.Fields(4)
.TextMatrix(.Rows - 1, 5) = rs.Fields(5)
.TextMatrix(.Rows - 1, 6) = rs.Fields(6)
.TextMatrix(.Rows - 1, 7) = rs.Fields(7)
.TextMatrix(.Rows - 1, 8) = rs.Fields(8)
.TextMatrix(.Rows - 1, 9) = rs.Fields(9)
.TextMatrix(.Rows - 1, 10) = rs.Fields(10)
.TextMatrix(.Rows - 1, 11) = rs.Fields(11)
.TextMatrix(.Rows - 1, 12) = rs.Fields(12)
.TextMatrix(.Rows - 1, 13) = rs.Fields(13)
.TextMatrix(.Rows - 1, 14) = rs.Fields(14)
rs.MoveNext
Loop
End With
End If
rs.Close

End Sub

才给10分啊,懒得动