asp怎么输出指定数据库ID的内容.

来源:百度知道 编辑:UC知道 时间:2024/05/26 14:13:52
我用的是ACCESS的数据库,
ID class_name class_us
1 fds sdfd
2 pus pesd
3 ddd pesss
我在网页中放置几个格,每个格分别指定显示ID1,ID2,ID3的内容,怎么样做.

dim i,rs,sql,aaa,bbb
for 1 to i i=3
sql="select * from tab where id="&i
rs="....."
rs.open sql,conn,1,1
if not rs.eof and rs.bof then
aaa=aaa&i
aaa&i=rs("class_name")
bbb=bbb&i
bbb=rs("claww_us")
else
response.write "数据错误"
end if
rs.movenext
loop
在D1里写response.write aaa1
d2里写response.write aaa2
...........
这样写不知道对不对,我喝多了,有点晕~如不对找我吧,