请教,asp操作sql2000时怎么返回该行的所有数据

[复制链接]
查看11 | 回复9 | 2021-1-27 05:54:15 | 显示全部楼层 |阅读模式
有没有像php那样selectall
将表中某一行通过json形式全部返回
分 -->
回复

使用道具 举报

千问 | 2021-1-27 05:54:15 | 显示全部楼层
select*from表
这样就可以返回所有列
回复

使用道具 举报

千问 | 2021-1-27 05:54:15 | 显示全部楼层
我是想通过手机号这个字段,返回行,不是整个列哈!
回复

使用道具 举报

千问 | 2021-1-27 05:54:15 | 显示全部楼层



0then
response.write""
else
response.write""
endif
else
%>
""andsearch"all"then

finStr=","
pos=1
total=0
whileinstr(pos,search,finstr)>0
total=total+1
pos=instr(pos,search,finstr)+1
wend
'Response.Write""&total&""
'Response.Write""&str&""
sPart=Split(search,",")
dimling,yi,er,san,si,wu,liu,qi
iftotal=0then
ling=sPart(0)
endif
iftotal=1then
ling=sPart(0)
yi=sPart(1)
endif
iftotal=2then
ling=sPart(0)
yi=sPart(1)
er=sPart(2)
endif
iftotal=3then
ling=sPart(0)
yi=sPart(1)
er=sPart(2)
san=sPart(3)
endif
iftotal=4then
ling=sPart(0)
yi=sPart(1)
er=sPart(2)
san=sPart(3)
si=sPart(4)
endif
iftotal=5then
ling=sPart(0)
yi=sPart(1)
er=sPart(2)
san=sPart(3)
si=sPart(4)
wu=sPart(5)
endif
iftotal=6then
ling=sPart(0)
yi=sPart(1)
er=sPart(2)
san=sPart(3)
si=sPart(4)
wu=sPart(5)
liu=sPart(6)
endif

'qi=sPart(7)
endif
Rs_List.openstr,conn,1,1
Response.Write"显示字段"&search&":"
dowhilenotRs_List.Eof
ifsearch"all"andsearch""then
iftotal=0then
Response.WriteRs_List(ling)&""
endif
iftotal=1then
Response.WriteRs_List(ling)&""&Rs_List(yi)&""
endif
iftotal=2then
Response.WriteRs_List(ling)&""&Rs_List(yi)&""&Rs_List(er)&""
endif
iftotal=3then
Response.WriteRs_List(ling)&""&Rs_List(yi)&""&Rs_List(er)&""&Rs_List(san)&""
endif
iftotal=4then
Response.WriteRs_List(ling)&""&Rs_List(yi)&""&Rs_List(er)&""&Rs_List(san)&""&Rs_List(si)&""
endif
iftotal=5then
Response.WriteRs_List(ling)&""&Rs_List(yi)&""&Rs_List(er)&""&Rs_List(san)&""&Rs_List(si)&""&Rs_List(wu)&""
endif
iftotal=6then
Response.WriteRs_List(ling)&""&Rs_List(yi)&""&Rs_List(er)&""&Rs_List(san)&""&Rs_List(si)&""&Rs_List(wu)&""&Rs_List(liu)&""
endif
'Response.WriteRs_List(ling)&""&Rs_List(yi)&""&Rs_List(er)&""&Rs_List(san)&""&Rs_List(si)&""&Rs_List(wu)&""&Rs_List(liu)&""&Rs_List(qi)&""
else
Response.WriteRs_List("Hy_xh")&""&Rs_List("Hy_bh")&""&Rs_List("Hy_xm")&""&Rs_List("Hy_jp")&""&Rs_List("Hy_xb")&""&Rs_List("Hy_sr")&""&Rs_List("Hy_hydj")&""
endif
Rs_List.movenext
Loop
Rs_List.close
setRs_List=nothing

%>


如上,当search=all时,那段帮忙改成返回整行,谢谢!
回复

使用道具 举报

千问 | 2021-1-27 05:54:15 | 显示全部楼层
搞不懂说的啥意思,如果你的手机号的是唯一的,那么Select*fromHywhereHy_dh='"&tel&"'返回的肯定是当前整行数据啊,如果不是唯一的,就有可能是多行数据了啊
回复

使用道具 举报

千问 | 2021-1-27 05:54:15 | 显示全部楼层
感谢版本帮忙,实在不会asp
能否帮忙把语句改一下,tel=1333333333&search=all的时候,直接返回整行
回复

使用道具 举报

千问 | 2021-1-27 05:54:15 | 显示全部楼层
来个人呗来个人呗来个人呗
回复

使用道具 举报

千问 | 2021-1-27 05:54:15 | 显示全部楼层
select*from表WHEREtel=1333333333ANDsearch=all

回复

使用道具 举报

千问 | 2021-1-27 05:54:15 | 显示全部楼层
elseifsearch="all"then
str="Select*fromHywhereHy_dh='"&tel&"'"
这个查询语句肯定是没问题,只要你的电话号码没有重复的,那肯定是查询到了整行数据,你只要把它们都显示出来就行了
回复

使用道具 举报

千问 | 2021-1-27 05:54:15 | 显示全部楼层
select*from表wheretel=手机号ANDsearch=all
就是这样啊,是你表达的不太清楚啊。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行