根据传入的recordset对象实例,按表格输出内容子过程

类别:Asp 点击:0 评论:0 推荐:

function iif(cond,expr1,expr2)
 if cond then
  iif = expr1
 else
  iif = expr2
 end if
end function

sub outinfo(rst)

 allcount=rst.recordcount-1

 response.write "<TABLE id=tablemx><FORM METHOD=POST ACTION=manage.asp>"
    
  response.write "<TR><TD>all<INPUT TYPE=checkbox NAME=allselect></TD>"
  
  for k=0 to rst.fields.count-1

   response.write "<TD>"&rst(k).name&"</TD>"

  next

  response.write "</TR>"
 
 for i=0 to allcount

  response.write "<TR><TD>"&i&"<INPUT TYPE=checkbox NAME=su_no value='"&rst("su_no")&"'></TD>"

  for k=0 to rst.fields.count-1

   response.write "<TD>"&rst(k).value&"</TD>"

  next

  response.write "</TR>"&vbcrlf

  rst.movenext

 next

 response.write "</TABLE>Total records ["&allcount+1&"]</FORM>"

end sub

本文地址:http://com.8s8s.com/it/it7333.htm