admin
05-28-2003, 10:58 PM
<%
Set MyConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
MyConn.Open "myDSN"
RS.MaxRecords=25
RS.Open "SELECT yourColumn FROM yourTable", MyConn
WHILE NOT RS.EOF
Response.Write("<br>" & RS("yourColumn"))
RS.MoveNext
WEND
RS.Close
Set RS = Nothing
MyConn.Close
Set MyConn = Nothing
%>
Another way is using the TOP method...
SELECT TOP 25 * FROM yourTable ORDERED BY yourTable.fieldname, yourTable.fieldname2
Set MyConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
MyConn.Open "myDSN"
RS.MaxRecords=25
RS.Open "SELECT yourColumn FROM yourTable", MyConn
WHILE NOT RS.EOF
Response.Write("<br>" & RS("yourColumn"))
RS.MoveNext
WEND
RS.Close
Set RS = Nothing
MyConn.Close
Set MyConn = Nothing
%>
Another way is using the TOP method...
SELECT TOP 25 * FROM yourTable ORDERED BY yourTable.fieldname, yourTable.fieldname2