小弟有几句sql代码,那位大哥,大姐帮忙看一下

来源:百度知道 编辑:UC知道 时间:2024/05/28 03:47:28
Dim txtsql As String
Dim mrc As ADODB.Recordset
Dim txtsql1 As String
Dim mrc1 As ADODB.Recordset
Dim txtsql2 As String
Dim mrc2 As ADODB.Recordset
Dim txtsql3 As String
Dim mrc3 As ADODB.Recordset
Private Sub Command1_Click()
If Trim(Text1.Text) <> "" Then
txtsql1 = "借书证号= '" & Trim(Text1.Text) & "'"
End If
If Trim(Text2.Text) <> "" Then
If Trim(txtsql1) = "" Then
txtsql1 = "读者姓名= '" & Trim(Text2.Text) & "'"
Else
txtsql1 = txtsql1 & "and 读者姓名= '" & Trim(Text2.Text) & "'"
End If
End If
If Trim(Combo1.Text) <> "" Then
If Trim(txtsql1) = "" Then
txtsql1 = "所在专业'" & Trim(Combo1.Text) & "'"
Else

实在太多了 看的眼花缭乱的 出什么错 什么地方提示错误 ?

估计是connection close 了 或者 recordset没有关闭

---

在and 前面加个空格

'select * from 读者信息表 where 所在班级='101' and 所在班级='102'