当前位置: 代码迷 >> ASP >> 超级菜,一个参数判断有关问题
  详细解决方案

超级菜,一个参数判断有关问题

热度:98   发布时间:2012-02-17 17:50:41.0
超级菜,一个参数判断问题!
从上表单传来一个参数ID
<%
id=Trim(request( "id "))
if     id= " "   then
rs.open   "select   *   from   test   where   id   =1 "
else
rs.open   "select   *   from   test   where   id   = ' "&id& " ' "
end   if
%>
然后循环把所的结果放列表中,我想把两句合   我一句,请问该怎么写?



------解决方案--------------------
<%
id=Trim(request( "id "))
if id= " " then
strSQL = "select * from test where id =1 "
else
strSQL = "select * from test where id = ' "&id& " ' "
end if

rs.open strSQL

%>
  相关解决方案