刚学asp想请大侠帮忙看看

炜旭 2011-11-05 03:07:04
dim conn,rs,sqr1
set conn=Server.CreateObject("adodb.connection")
conn.Open "provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("news.mdb")
sqr1="select * from new1"
set rs=conn.Execute(sqr1)
%>
<table align="center" border="1">
<th>新闻标题</th>
<%
do while not rs.eof
%>
<tr>
<td><a href="3.asp?no=<%=rs("id")%>">
<%=rs("title")%> </a>

</td>
</tr>
<%
rs.movenext
loop
%>
</table>
<hr>
'<%
'请在这里输入您的ASP代码
dim conn, rs,sqr1
set conn=Server.CreateObject("adodb.connection")
conn.Open= "provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("news.mdb")
sqr1="select * from new2"
set rs=Server.Execute(sqr1)

%>
<table align="center">
<th>娱乐</th>
<%do while not rs.eof%>
<tr>
<td>
<a href="2.asp?no=<%=rs("id")%>"><%=rs("title")%></a>
</td>
</tr>
<%
rs.movenext
loop
%>
</table>
<%
'请在这里输入您的ASP代码
dim conn, rs,sqr1
set conn=Server.CreateObject("adodb.connection")
conn.Open= "provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("news.mdb")
sqr1="select * from new1"
set rs=Server.Execute(sqr1)

%>
<table align="right">
<th>教育<th>
<%do while not rs.eof%>
<tr>
<td>
<a href="1.asp?no=<%=rs("id")%>"><%=rs("title")%></a>
</td>
</tr>
<%
rs.movenext
loop
%>
</table>
<%
'请在这里输入您的ASP代码
dim conn, rs,sqr1
set conn=Server.CreateObject("adodb.connection")
conn.Open= "provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("news.mdb")
sqr1="select * from new1"
set rs=Server.Execute(sqr1)

%>
<table align="left" border="1">
<h1>科技</h1>
<%do while not rs.eof%>
<tr>
<td>
<a href="4.asp?no=<%=rs("id")%>"><%=rs("title")%></a>
</td>
</tr>
<%
rs.movenext
loop
%>
错误结论是
错误代码:dim conn, rs,sqr1
错误描述:名称重定义
...全文
78 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
frankrenping 2011-11-10
  • 打赏
  • 举报
回复
确实应该学.NET了,asp没钱途了。
吉普赛的歌 2011-11-10
  • 打赏
  • 举报
回复
转向.net吧, 把asp头疼时间来拿学习就是了.
yessanya 2011-11-10
  • 打赏
  • 举报
回复
将数据库文件写入模块
<!--#include file=""-->
mztycom 2011-11-10
  • 打赏
  • 举报
回复
dim conn, rs,sqr1
set conn=Server.CreateObject("adodb.connection")
conn.Open= "provider=microsoft.www.mzty.com.jet.oledb.4.0;data source=" & server.MapPath("news.mdb")
这段代码只写一次就行了,不用写3次
a6623698 2011-11-10
  • 打赏
  • 举报
回复
重定义了
aa331730417 2011-11-05
  • 打赏
  • 举报
回复
应该报名称4重定义的错误
aa331730417 2011-11-05
  • 打赏
  • 举报
回复
貌似写了4次
aykkk 2011-11-05
  • 打赏
  • 举报
回复
dim conn, rs,sqr1
set conn=Server.CreateObject("adodb.connection")
conn.Open= "provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("news.mdb")
这段代码只写一次就行了,不用写3次,另外,建议你还是学asp.net吧,asp快要淘汰了
xiakelc 2011-11-05
  • 打赏
  • 举报
回复
名称重定义

28,408

社区成员

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

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