如何用ASP显示SQL表单?

bbk_simon 2003-07-28 02:42:43
ASP菜鸟问题.
有一句SQL语句 select * from aaa
请问如何在用ASP在页面中显示出SQL结果的那张二维表.
谢谢
...全文
90 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
bbk_simon 2003-07-28
  • 打赏
  • 举报
回复
楼上的谢谢了先!
请问,如何用dictionary做呢?
假定select a,b,c from AAA
xiaobird1 2003-07-28
  • 打赏
  • 举报
回复
这只是一个例子:

listsql = "select * from temp"
rs.open listsql, dbcon, 3, 1
for i = 0 to rs.Fields.Count - 1
Response.write rs.Fields(i).name & " "
next
Response.write "<br>"
for i = 0 to rs.RecordCount - 1
for j = 0 to rs.Fields.Count - 1
Response.write rs(j) & " "
next
Response.write "<br>"
rs.Movenext
next

如果代码有问题,请予更正。这只是一个例子。
zl13 2003-07-28
  • 打赏
  • 举报
回复
<%
sql = "select * from aaa"
Set rs = conn.execute(sql)
%>
<table>
<%
Do while not rs.Eof
response.write "<tr><td>"
response.write rs("aaa里的字段名")
response.write "</td></tr>"
rs.MoveNext
loop
%>
</table>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧