encryption什么意思:asp由access升级到sql后遇到错误 '80020009'

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/26 20:15:07
错误 '80020009'
/ads/index_fly.asp,行 10

这是文件的代码,帮我看看好吗?

<meta http-equiv="Content-Language" content="zh-cn">
<!-- <LINK href="css/Style.css" rel=stylesheet type=text/css> -->
<%
dim ggsql
dim ggrs
ggsql="select * from banner where bz=1 and picurl<>'""' order by LinkID"
Set ggrs= Server.CreateObject("ADODB.Recordset")
ggrs.open ggsql,conn,1,1
%>
<%if ggrs("picurl")<>"" then%>
<%do while not ggrs.eof%>
<SCRIPT language=javascript>
var mvtLight="linkurl/picture/<%=ggrs("picurl")%>"
var mvtLink="<%=ggrs("web")%>"
var mvtAlt="<%=ggrs("deseriptor")%>"

"80020009"错误一般来说都是由于eof造成的。
你的程序应该改一下,一般连接数据表后要先来判断<%If not ggrs.eof Then%>,建议将<%if ggrs("picurl")<>"" then%>移动到循环里面,就OK了,具体如下:
<meta http-equiv="Content-Language" content="zh-cn">
<!-- <LINK href="css/Style.css" rel=stylesheet type=text/css> -->
<%
dim ggsql
dim ggrs
ggsql="select * from banner where bz=1 and picurl<>'""' order by LinkID"
Set ggrs= Server.CreateObject("ADODB.Recordset")
ggrs.open ggsql,conn,1,1
%>
<%do while not ggrs.eof%>
<%if ggrs("picurl")<>"" then%>
<SCRIPT language=javascript>
var mvtLight="linkurl/picture/<%=ggrs("picurl")%>"
var mvtLink="<%=ggrs("web")%>"
var mvtAlt="<%=ggrs("deseriptor")%>"
……
……
<%end if%>
<%loop%>