当前位置: 首页 > 图文教程 > 数据库 > MYSQL > ASP连接MySQL数据库的方法

MYSQL
V3host.be 比利时150M可绑米DA面板免费PHP空间
教程:MYSQL创建触发程序的方法
教程:MySQL中多表操作和批处理方法
关于MySQL中隐藏空间的问题
MySQL数据库在Linux下二进制日志恢复方法
分析与比较五种MySQL数据库可靠性方案
在Ubuntu下的MySQL数据库如何更改存储位置
MySQL插入表格查询的技巧
介绍MySQL用户root密码为空的另类攻击方法
MySQL数据库的23个安全注意事项
浅谈MySQL+PHP产生乱码的原理及解决方法
浅析MySQL中隐藏空间问题
使用Netbeans操作MySQL数据库的方法
lighttpd+PHP(FAST-CGI)++MySQL的具体步骤
浅谈MySQL数据库中如何解决分组统计的问题
MySQL与.NET应用解析
MySQL数据库中的安全解决方案
MyISAM-性能与特性的折中
MySQL数据库环境使用攻略
MYSQL没有完全卸载将导致其安装不成功

MYSQL 中的 ASP连接MySQL数据库的方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-17   浏览: 56 ::
收藏到网摘: n/a

<%
'测试读取MySql数据库的内容

strconnection="driver={mysql odbc 3.51 driver};database=weste_net;server=localhost;uid=root;password="
'无需配置dsn
set adodataconn = server.createobject("adodb.connection")
adodataconn.open strconnection

strquery = "select * from News"
set rs = adodataconn.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("News_id")%></td>
<td><%=rs("News_Title")%></td>
</tr>
<%
rs.movenext
loop
%>
</table>
<%
else
response.write("无数据.")
end if
rs.close
adodataconn.close
set adodataconn = nothing
set rsemaildata = nothing
%>

PS:若想直接使用以上代码,请将全角符号“<>”替换成半角符号“<>”。