若有下表: id title srdate body ----------------------------------------------------- 1 动网 2005-9-9 dvbbs.net 2 商务在线 2004-9-9 zicp.com 3 网易 2008-9-9 163.com 表达式为: SQL rs="select body,title,srdate from news where id=" & id [转自:711网络工作室 http://www.tc711.com]
这时,rs就是一个数组,分别有: rs(0)=body rs(1)=title rs(2)=srdate 注意:这里的012分别对应于body,title,srdate的顺序 [转自:711网络工作室 http://www.tc711.com]
如果这里的id=2,那么:
<%= rs(0) %> 值为: zicp.com
<%= rs(1) %> 值为: 商务在线
<%= rs(2) %> 值为: 2004-9-9
<%= rs("body") %>等价于:rs(0)
<%= rs("title") %>等价于:rs(1)
<%= rs("srdate") %>等价于:rs(2)
还有就是性能上的区别,rs(0)比rs("字段名")要快! |