ASP连接MYSQL数据库

来源:互联网 发布:淘宝的认证照片怎么拍 编辑:程序博客网 时间:2024/06/06 00:05
<script type="text/javascript"><!--google_ad_client = "pub-4490194096475053";/* 内容页,300x250,第一屏 */google_ad_slot = "3685991503";google_ad_width = 300;google_ad_height = 250;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<IFRAME name=google_ads_frame marginWidth=0 marginHeight=0 src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4490194096475053&amp;dt=1228361390484&amp;lmt=1226285649&amp;prev_slotnames=1891601125&amp;output=html&amp;slotname=3685991503&amp;correlator=1228361390453&amp;url=http%3A%2F%2Fwww.corange.cn%2Farchives%2F2008%2F09%2F1766.html&amp;ea=0&amp;ref=http%3A%2F%2Fwww.corange.cn%2Fhtml%2Fcorange__94.html&amp;frm=0&amp;ga_vid=368793713.1228304108&amp;ga_sid=1228359086&amp;ga_hid=301695660&amp;ga_fc=true&amp;flash=9.0.124.0&amp;u_h=768&amp;u_w=1024&amp;u_ah=715&amp;u_aw=1024&amp;u_cd=32&amp;u_tz=480&amp;u_java=true&amp;dtd=31" frameBorder=0 width=300 scrolling=no height=250 allowTransparency></IFRAME>
<%
strconnection="driver={mysql odbc 3.51 driver};database=weste_net;server=localhost;uid=root;password="
set conn = server.createobject("adodb.connection")
conn.open strconnection
strquery = "select * from News"
set rs = conn.execute(strquery)
if not rs.bof then
%>
<table>
<tr>
<td<b>序列号</b></td>
<td><b>标题</b></td>
</tr>
<%
do while not rs.eof
%>
<tr>
<td><%=rs("id")%></td>
<td><%=rs("NTitle")%></td>
</tr>
<%
rs.movenext
loop
%>
</table>
<%
else
response.write("无暂时没有.")
end if
rs.close
conn.close
set conn = nothing
set rsdata = nothing
%>
原创粉丝点击