
做ASP网页中想用SQL查询Access数据库中的超链接字段
Access数据库的数据表中有一个字段我定义的数据类型是超链接,但在自己做的asp查询网页中,查到的这个字段都是以文本形式显示,例如原数据表中的字段是"网易",编辑的超链...
Access数据库的数据表中有一个字段我定义的数据类型是超链接,但在自己做的asp查询网页中,查到的这个字段都是以文本形式显示,例如原数据表中的字段是"网易",编辑的超链接是"http://www.163.com",而查询结果网页中显示的是"网易#http://www.163.com#",而且不能点击,这并不是我想要的只显示"网易"而且是可以点击的链接形式.是我的查询网页有问题吗?能给相应的代码呢?多谢了!
十分感谢这么快而热心的回答!要把6个字段(只有1个是超链接)都显示出来,应该把如何区分开文本和超链接呢?是不是直接把"<%response.write "<a href='" & url & "' title='" & name & "'>" %> "这句代码加入即可?要加在什么地方呢?以下是原来部分代码.
If Request("no") = "" Then
Session("no")=1
else
select case Request("no")
case "First"
Session("no")=1
case "Previous"
Session("no")=Session("no")-1
case "next"
Session("no")=Session("no")+1
case "last"
Session("no")=RS.RecordCount
end select
End If
if Session("no")>RS.RecordCount then Session("no")=RS.RecordCount
if Session("no")<1 then Session("no")=1
Response.write "<table border=1 align=center cellspacing=0 cellpadding=4 height=390>"
Response.write "<TR><td width=100><td width=195>"
ShowPage RS, Session("no")
Response.write "</table>"
RS.close
set RS=nothing
conn.close
set conn=nothing
end if
%> 展开
十分感谢这么快而热心的回答!要把6个字段(只有1个是超链接)都显示出来,应该把如何区分开文本和超链接呢?是不是直接把"<%response.write "<a href='" & url & "' title='" & name & "'>" %> "这句代码加入即可?要加在什么地方呢?以下是原来部分代码.
If Request("no") = "" Then
Session("no")=1
else
select case Request("no")
case "First"
Session("no")=1
case "Previous"
Session("no")=Session("no")-1
case "next"
Session("no")=Session("no")+1
case "last"
Session("no")=RS.RecordCount
end select
End If
if Session("no")>RS.RecordCount then Session("no")=RS.RecordCount
if Session("no")<1 then Session("no")=1
Response.write "<table border=1 align=center cellspacing=0 cellpadding=4 height=390>"
Response.write "<TR><td width=100><td width=195>"
ShowPage RS, Session("no")
Response.write "</table>"
RS.close
set RS=nothing
conn.close
set conn=nothing
end if
%> 展开
展开全部
<%
dim rs
dim sql
sql="select url,id,name from l order by id desc"
set rs=server.createobject("ADODB.recordset")
rs.open sql,conn,1,3
%>
在要现实的地方输入如下代码
<%
response.write "<a href='" & url & "' title='" & name & "'>"
%>
l是数据库里的表名字
id是数据库里l表的字段名称一般为自动编号
url为l表里的字段,就是储存链接地址的字段
name为l表里的字段,就是储存链接名称的字段
dim rs
dim sql
sql="select url,id,name from l order by id desc"
set rs=server.createobject("ADODB.recordset")
rs.open sql,conn,1,3
%>
在要现实的地方输入如下代码
<%
response.write "<a href='" & url & "' title='" & name & "'>"
%>
l是数据库里的表名字
id是数据库里l表的字段名称一般为自动编号
url为l表里的字段,就是储存链接地址的字段
name为l表里的字段,就是储存链接名称的字段
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |