利用vbscript脚本技术编写一个asp动态网页用来显示某个数据库ACCESS中的信息 求代码 要完整的 谢谢
1个回答
展开全部
<%
'数据库连接部分
dim conn,connstr,mdb
mdb="mdb/#web_hekui_com#.mdb"
on error resume next
Set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb)
conn.Open connstr
If err>0 Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
dim sql,rs
sql="select * from news where classid=3 order by istop desc,adddate desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("暂无新闻。")
else
do while not rs.eof
'这里自己定义显示样式
response.write("Title")&"<br />"
rs.movenext
loop
end if
rs.close()
set rs=nothing
conn.close()
set conn=nothing
%>
'数据库连接部分
dim conn,connstr,mdb
mdb="mdb/#web_hekui_com#.mdb"
on error resume next
Set conn=Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(mdb)
conn.Open connstr
If err>0 Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
dim sql,rs
sql="select * from news where classid=3 order by istop desc,adddate desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("暂无新闻。")
else
do while not rs.eof
'这里自己定义显示样式
response.write("Title")&"<br />"
rs.movenext
loop
end if
rs.close()
set rs=nothing
conn.close()
set conn=nothing
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询