<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ASP读取MYsql数据库测试</title>
<%
strconnection="driver={mysql odbc 5.1 driver};database=数据库名;server=localhost;uid=数据库用户名;password=数据库密码"
set adodataconn = server.createobject("adodb.connection")
adodataconn.open strconnection
strquery = "select * from 数据库的一个表名"
set rs = adodataconn.execute(strquery)
if not rs.bof then
%>
<table>
<%
do while not rs.eof
%>
<tr>
<td><%=rs("上面表的字段1")%></td>
<td><%=rs("上面表的字段2")%></td>
</tr>
<%
rs.movenext
loop
%>
</table>
<%
else
response.write("无数据.")
end if
rs.close
adodataconn.close
set adodataconn = nothing
set rsemaildata = nothing
%>
