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

MYSQL
预防性维护MySQL数据库服务器详解
MySQL服务器内部安全数据目录访问
如何使用MySQL系统的发布与安装
关于MySQL数据库的存储引擎详细介绍
通过数据库引擎来加速MySQL数据库
关于MySQL数据库的用户认证系统分析
在MySQL中获得更好的全文搜索结果
教你如何使用触发器管理MySQL数据库
保护MySQL数据库中重要的数据注意事项
用新的PHP插件实现MySQL为基础的事务
MySQL 4.1数据库中数据转换注意事项
优化MySQL数据库查询的三种方法简介
MySQL数据库批量导入脚本
MySQL中如何灵活运用tips功能
向你介绍MySQL数据库备份的简单知识
通过PHP连接My SQL的两种方法简介
MySQL数据库账户授权的相关管理解析
用Perl DBI连接MySQL数据库
MySQL数据库安全配置
快速修复mysql数据库

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-17   浏览: 36 ::
收藏到网摘: 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:若想直接使用以上代码,请将全角符号“<>”替换成半角符号“<>”。