asp连接mysql数据库例子,直接将例子贴出来,大家看看会不会
<%
Connstr="dsn=mydsn;driver={myodbd driver};server=localhost;uid=root;pwd=;database=mydatabase"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Connstr
strQuery = "SELECT * FROM users"
Set rs = Conn.Execute(strQuery)
If Not rs.eof Then
%>
<TABLE>
<TR>
<TD<b>用户名</b></TD>
<TD><b>密码</b></TD>
</TR>
<%
Do While Not rs.EOF
%>
<TR>
<TD><%=rs("username")%></TD>
<TD><%=rs("password")%></TD>
</TR>
<%
rs.MoveNext
Loop
%>
</TABLE>
<%
Else
Response.Write("没有记录")
End If
rs.Close
Conn.Close
Set Conn = Nothing
Set rs = Nothing
%>
关键的地方就是在asp连接mysql数据库
中国足彩网信息请查看IT技术专栏
2025国考·省考课程试听报名