当前位置: 代码迷 >> ASP >> 怎么在asp显示结果集
  详细解决方案

怎么在asp显示结果集

热度:85   发布时间:2012-02-15 12:09:43.0
如何在asp显示结果集
Set   conn   =   Server.CreateObject( "ADODB.Connection ")
DSNtemp= "DRIVER={SQL   Server};SERVER=localhost;UID=sa;PWD=sa;DATABASE=health "
conn.open   DSNtemp
sql   =   "select   name   from   Sys_depart_info "
Set   Rs   =   conn.ExeCute( "select   *   from   Sys_depart_info ")

循环显示,结果集,怎么写呢?谢谢大家

------解决方案--------------------
while not rs.eof
response.write(rs(0)& " "&rs(1))
wend
------解决方案--------------------
for n=1 ro rs.recordcount
for m=0 to rs.Fields.Count-1
a=rs(m) '只是一个意思,用于显示内容的语句
next
next
  相关解决方案