sql 联合查询显示不全
jiajia=or(codelike'%6229%')or(codelike'%6230%')or(codelike'%6231%')sqlstr="select*fro...
jiajia=or (code like'%6229%')or (code like'%6230%')or (code like'%6231%')
sqlstr="select * from tb where "&jiajia&""
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'or (code like'%6229%')or (code like'%6230%')or (code like'%6231%')or (code like'%10696%')or (code like'%10697%')or (code like'%10698%')' 中。
请教高手
另外用
sqlstr="select * from tb where (code like'%"& CLng(arrB(0)) & "%') "&jiajia&""
rs.open sqlstr,conn,1,3
If RS.Bof OR RS.Eof Then
Response.Write "<p align=center>nothing!</p>"
Else
rs.movefirst'
response.write (rs("code"))
response.write "<br>"
rs.movenext
rs.close
end if
只能显示第一条记录,第二以后的都不可以显示,为什么?
请教高手 展开
sqlstr="select * from tb where "&jiajia&""
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'or (code like'%6229%')or (code like'%6230%')or (code like'%6231%')or (code like'%10696%')or (code like'%10697%')or (code like'%10698%')' 中。
请教高手
另外用
sqlstr="select * from tb where (code like'%"& CLng(arrB(0)) & "%') "&jiajia&""
rs.open sqlstr,conn,1,3
If RS.Bof OR RS.Eof Then
Response.Write "<p align=center>nothing!</p>"
Else
rs.movefirst'
response.write (rs("code"))
response.write "<br>"
rs.movenext
rs.close
end if
只能显示第一条记录,第二以后的都不可以显示,为什么?
请教高手 展开
展开全部
一.jiajia="or (code like'%6229%')or (code like'%6230%')or (code like'%6231%') "
二.
sqlstr="select * from tb where (code like'%"& CLng(arrB(0)) & "%') "李雹衡&jiajia&""
rs.open sqlstr,conn,1,3
If RS.Bof OR RS.Eof Then
Response.Write "<p align=center>nothing!</p>"
Else
rs.movefirst'
response.write (rs("code"))
response.write "<br>"
rs.movenext
rs.close
end if
你这个没有循环语句,当然只显示第一条肆芦
改成
sqlstr="select * from tb where (code like'%"& CLng(arrB(0)) & "%') "&jiajia&""
rs.open sqlstr,conn,1,3
If RS.Bof OR RS.Eof Then
Response.Write "<p align=center>nothing!</p>"
Else
rs.movefirst
do while not rs.eof
response.write (rs("code"哪做))
response.write "<br>"
rs.movenext
loop
rs.close
end if
二.
sqlstr="select * from tb where (code like'%"& CLng(arrB(0)) & "%') "李雹衡&jiajia&""
rs.open sqlstr,conn,1,3
If RS.Bof OR RS.Eof Then
Response.Write "<p align=center>nothing!</p>"
Else
rs.movefirst'
response.write (rs("code"))
response.write "<br>"
rs.movenext
rs.close
end if
你这个没有循环语句,当然只显示第一条肆芦
改成
sqlstr="select * from tb where (code like'%"& CLng(arrB(0)) & "%') "&jiajia&""
rs.open sqlstr,conn,1,3
If RS.Bof OR RS.Eof Then
Response.Write "<p align=center>nothing!</p>"
Else
rs.movefirst
do while not rs.eof
response.write (rs("code"哪做))
response.write "<br>"
rs.movenext
loop
rs.close
end if
展开全部
你看看这段
set rs = Server.CreateObject("ADODB.RecordSet")
sql = "Select * From movieurl Where nameid='"&request("id1")&"'让扰"
rs.open sql,conn,1,3
if rs.eof or rs.bof then
response.write "氏滑弊数据库中没有有效地址"
else
do while not rs.eof
i = i + 1
if i < 10 then
inum = "0" & i
else
inum = i
end if
list = list & "<a href='Play.asp?id=" & rs("id") & "&id1="&request("id1")&"&id2=" & request("id2"歼族) &
"&inum="&inum&"' target='oPlayFrame'>"&inum&"</a> "
if i mod 10 = 0 then list = list & "<br>"
rs.movenext
loop
rs.close
set rs = nothing
conn.close
set conn = nothing
end if
set rs = Server.CreateObject("ADODB.RecordSet")
sql = "Select * From movieurl Where nameid='"&request("id1")&"'让扰"
rs.open sql,conn,1,3
if rs.eof or rs.bof then
response.write "氏滑弊数据库中没有有效地址"
else
do while not rs.eof
i = i + 1
if i < 10 then
inum = "0" & i
else
inum = i
end if
list = list & "<a href='Play.asp?id=" & rs("id") & "&id1="&request("id1")&"&id2=" & request("id2"歼族) &
"&inum="&inum&"' target='oPlayFrame'>"&inum&"</a> "
if i mod 10 = 0 then list = list & "<br>"
rs.movenext
loop
rs.close
set rs = nothing
conn.close
set conn = nothing
end if
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
jiajia=" (code like'芹烂搏%6229%')or (code like'%6230%')or (code like'嫌祥%6231%'历搭)"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询