asp連接mysql數(shù)據(jù)庫(kù)例子,直接將例子貼出來(lái),大家看看會(huì)不會(huì)
<%
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("沒(méi)有記錄")
End If
rs.Close
Conn.Close
Set Conn = Nothing
Set rs = Nothing
%>
關(guān)鍵的地方就是在asp連接mysql數(shù)據(jù)庫(kù)
更多信息請(qǐng)查看IT技術(shù)專欄