asp如何显示数据库中的图片和超级链接?

时间:2010-06-08 09:38:00 

如何显示数据库中的图片和超级链接?

代码见下:

<% 
set conn=server.creatobject("ADODB.connection")
conn.open "myaddress"
set rs=conn.execute("select name,tel,url,image from
myaddress")
%>
<p>
<tabel>
<tr>
<% for i=0 to rs.fields.count-1 %>
<td>
<b>
<%=rs(i).name %>
</b>
</td>
<% next %>
</tr>
<% do while not rs.eof %>
<tr>
<% for i=0 to rs.fields.count-1 %>
<td valign =top>
<% 
if rs(i).name="image" then
response.write "<img src="""&rs(i)&""" >"
else
if rs(i).name="url" then
response.write "<a href="""&rs(i)&""">"&rs(i)&"</a>"
else
response.write rs(i)
end if
end if
%>
</td>
<%next%>
</tr>
<% rs.movenext
loop
rs.close
conn.close
%>
</html>

标签:asp,数据库,图片,超级链接
0
投稿

猜你喜欢

  • python保存文件方法小结

    2021-09-09 04:13:59
  • python中用logging实现日志滚动和过期日志删除功能

    2021-03-17 14:21:18
  • 用pickle存储Python的原生对象方法

    2023-10-31 04:43:13
  • Python plt 利用subplot 实现在一张画布同时画多张图

    2021-02-04 02:50:17
  • python运行或调用另一个py文件或参数方式

    2023-10-26 02:04:47
  • Python数学建模PuLP库线性规划入门示例详解

    2023-06-13 13:06:20
  • python基础知识之字典(Dict)

    2023-08-25 20:01:44
  • 将mysql转换到oracle必须了解的50件事

    2010-07-05 12:15:00
  • 详解Django中六个常用的自定义装饰器

    2021-02-10 03:03:09
  • 实例讲解python中的协程

    2022-08-10 20:10:38
  • PHP一文带你搞懂游戏中的抽奖算法

    2024-06-05 09:38:21
  • Python查询IP地址归属完整代码

    2022-10-18 16:39:07
  • SQL Server主键约束(PRIMARY KEY)

    2024-01-24 04:46:56
  • PyCharm搭建一劳永逸的开发环境

    2022-12-23 20:24:23
  • 一文搞懂 parseInt()函数异常行为

    2024-04-30 08:57:11
  • Django分页器的用法你都了解吗

    2022-06-06 21:18:39
  • SQL Server中的执行引擎入门 图解

    2012-06-06 20:08:26
  • MySQL系列之三 基础篇

    2024-01-25 21:09:28
  • Python中的ceil()方法使用教程

    2022-02-01 05:15:11
  • 检测浏览器对事件的支持程度

    2009-12-23 19:40:00
  • asp之家 网络编程 m.aspxhome.com