请教asp的怎样从access数据库的abc字段提取数据显示啊?

来源:百度知道 编辑:UC知道 时间:2024/05/26 19:48:59
请教asp的怎样从access数据库的abc字段提取数据显示啊?参考代码如下:<!--#include file="conn.asp"-->
<%
dim Cid
Cid = SQLRequestImmit(2,"Get","Cid")
dim sqlw,Url
sqlw="select abc from abc where abcID="&Cid&""

set rsw=server.createobject("adodb.recordset")
rsw.open sqlw,conn,1,1
if not rsw.eof then
while not rsw.eof
%>
<%
Url=rsw("abc")
if Url="" then
response.Redirect("error.htm")
response.End()
else
response.Redirect(Url)
response.End()
end if
%>
<span class="STYLE4"><a href="显示在这里"> 提取显示数据</a> </span> </td>
<%
rsw.movenext
wend
end if
rsw.close
set rsw=nothing
%>
这么多高手啊,先谢谢啦,我回家试下看啊:)

<%
Url=rsw("abc")
if Url="" then
response.Redirect("error.htm")
response.End()
else
response.Redirect(Url)
response.End()
end if
%>
<span class="STYLE4"><a href="显示在这里"> 提取显示数据</a> </span> </td>
你上面代码中不管abc字段是否有值都把页面跳转了!

改成:
<%
Url=rsw("abc")
%>
<span class="STYLE4"><a href="<%=Url%>"> <%=Url%></a> </span> </td>
试试看

<a href="显示在这里<%=数据绑定的表%>"> <%=数据绑定的表%>"> </a>

你没发现你的程序有问题么?
Url=rsw("abc")
if Url="" then
response.Redirect("error.htm")
response.End()
else
response.Redirect(Url)
response.End()
end if
URL的值要么是空,要么不是空,对吧?
也就是说不管URL的值为何时,都会发生跳转!
那么它下面的语句
<span class="STYLE4"><