ASP网页设计中“缺少对象”

kecheng 2006-06-15 12:20:30
错误信息:
行:125
字符:1
错误:缺少对象
代码:0
URL:http://localhost/614aft/index.asp
请问这是什么问题?错在哪里?该如何改才不会出错?

116 <table width="100%" border="0" cellspacing="0" cellpadding="0">
117 <tr>
118 <td width="49%"> 企业新闻>></td>
119 <td width="51%"> 业内资讯>></td>
120 </tr>
121 <tr>
122 <td colspan="2"><table width="100%" border="1" cellpadding="0" 123cellspacing="0" bordercolor="#FFFFCC" >
124 <tr>
125 <td height="100" colspan="2">
126 <%
127set rs_news=server.createobject("adodb.recordset")
128sqltext4="select top 5 * from news where BigClassName='企业新闻' order by id desc"
129rs_news.open sqltext4,conn,1,1
130%>
131 <table width="100%" border="0" cellspacing="1" 132cellpadding="0">
133 <tr>
134 <td width="7%" height="8"></td>
135 <td width="93%"></td>
136 </tr>
137 <%i=0
138do while not rs_news.eof%>
139 <tr align="center">
140 <td><img src="Img/arrow_6.gif" width="11" height="11"> 141</td>
142 <td style='BORDER-bottom: #999999 1px dotted'><div
143
144align="left">
145 <p style='line-height:150%'><a
146
147href="shownews.asp?id=<%=rs_news("id")%>" target="_blank"> <%=cutstr(rs_news ("title"),22)%></a><br>
149 </div></td>
150 </tr>
151 <%rs_news.movenext
152i=i+1
153if i=5 then exit do
154loop
155rs_news.close %>
156 <tr>
157 <td height="8"></td>
158 <td></td>
159 </tr>
160 </table></td>
161 <td width="51%" colspan="2">
162 <%
163set rs_news=server.createobject("adodb.recordset")
164sqltext4="select top 5 * from news where BigClassName='业内资讯' order by id desc"
165rs_news.open sqltext4,conn,1,1
166%>
167 <table width="100%" border="0" cellspacing="1" 168cellpadding="0">
169 <tr>
...全文
240 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
kecheng 2006-06-16
  • 打赏
  • 举报
回复
谢谢各位,我已经解决这下问题了,原来是head.asp里面的初始化问题,把里面的online="init()"这句给删了就可以了。
对于flyingsnowy(等到我变成星星我就转.Net了(欧杨飘雪)) ,谢谢你的参与,不过你太自傲了,还没清楚问题就说是conn的问题,我是使用Microsoft Visual Studio 2005来检查出错误的,这个工具挺好的,建议大家要查找代码错误时使用这个工具。
北京不不 2006-06-15
  • 打赏
  • 举报
回复
数据库的连接代码有吗?包含进来没有。
flyingsnowy 2006-06-15
  • 打赏
  • 举报
回复
哎.conn呢.

不说了.
sy_binbin 2006-06-15
  • 打赏
  • 举报
回复
错误信息:
行:125
字符:1
错误:缺少对象
代码:0


这好像不是VB脚本的错误吧
kecheng 2006-06-15
  • 打赏
  • 举报
回复
第125行是这样的:
<%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select top 5 * from news where BigClassName='企业新闻' order by id desc"
rs_news.open sqltext4,conn,1,1
%>
starsword 2006-06-15
  • 打赏
  • 举报
回复
你先在报错的页面点击右键,选择查看源文件,然后在打开的源文件里用 CTRL+G 找到125行是哪一行,没估计错的话,应该是这行调用了JS,是调用问题,再去相应的源程序里去改
kecheng 2006-06-15
  • 打赏
  • 举报
回复
这是数据库的连接,有问题吗?
<%
dim conn
dim connstr
dim db
db="../Databases/data1.mdb" '数据库文件位置
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else
conn.open connstr
end if

sub CloseConn()
conn.close
set conn=nothing
end sub

%>
xxuu503 2006-06-15
  • 打赏
  • 举报
回复
JS错误

要看页面source

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧