菜鸟请教ASP向ACCESS中添加超链接显示路径问题

来源:百度知道 编辑:UC知道 时间:2024/06/06 01:23:06
向ACCESS中添加了一列link超链接,显示的时候用代码<a href="<%=rs("link")%>">显示出来的是当前ASP文件路径#超链接#
比如我的当前文件是localhost/1/1.asp,超链接为localhost/2/2.html他显示就是localhost/1/1.asp#localhost/2/2.html#
本人菜鸟。请教下各位
我没说清楚问题,在ACCESS中超链接是localhost/2/2.html,而我要显示的也是这个,但是从数据库中搜索出一条信息点击变成localhost/1/1.asp#localhost/2/2.html# 了。怎么办
路径就是啊,是我自己添加的超链接 ,用respongse.write strlink显示的是#localhost/2/2.html#

如果你在ACCESS中的LINK字段中存放的数据格式为:“当前ASP文件路径#超链接# ”,则:
link="http://" & Request.ServerVariables("Http_Host") & Request.ServerVariables("path_info") & "#" & 你存的超级链接变量 & "#"
然后将LINK写入数据库LINK字段;
如果你在ACCESS中的LINK字段中存放的数据格式为:“超链接#”,而要显示成“当前ASP文件路径#超链接# ”则:
strlink="http://" & Request.ServerVariables("Http_Host") & Request.ServerVariables("path_info") & "#" & rs("link") & "#"
<a href="<% =strlink %>">
====================================
strlink=rs("link")
你可以直接用response.write strlink显示一下从数据库中检索到的数据,看是不是确实就是localhost/2/2.html

myself = request.servervariables("path_info")
response.write(myself)