建立ASP文件链接数据库 例子如下 Windows DSN name: 所要建立DSN的名称 Mysql Host (name or ip):Mysql服务器的名称或者是IP地址,通常填localhost Mysql database name: admin Database: admin password: 000000 Port(if not 3306): SQL command on connect:
strQuery = "SELECT * FROM user" Set rs = adoDataConn.Execute(strQuery) If Not rs.BOF Then %> TABLE> TR> TDb>username/b>/TD> TD>b>password/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("Sorry, no data found.") End If
rs.Close adoDataConn.Close Set adoDataConn = Nothing Set rsEmailData = Nothing %>
strQuery = "SELECT * FROM user" Set rs = adoDataConn.Execute(strQuery) If Not rs.BOF Then %> TABLE> TR> TDb>username/b>/TD> TD>b>password/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("Sorry, no data found.") End If
rs.Close adoDataConn.Close Set adoDataConn = Nothing Set rsEmailData = Nothing %>