%@ LANGUAGE = VBScript %>
<% Option Explicit %>
LimitRows From Database
LimitRows From Database
Contacts within the Authors Database:
<%
Dim oConn
Dim oRs
Dim curDir
Dim Index
' Map authors database to physical path
curDir = Server.MapPath("authors.mdb")
' Create ADO Connection Component to connect
' with sample database
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir
' Create ADO Recordset Component
Set oRs = Server.CreateObject("ADODB.Recordset")
Set oRs.ActiveConnection = oConn
' Set Recordset PageSize so that it only
' holds 10 rows
oRs.PageSize = 10
' Get recordset
oRs.Source = "SELECT * FROM authors"
oRs.CursorType = adOpenStatic
' Open Recordset
oRs.Open
%>
<%
Dim RecordCount
RecordCount = 0
Do while ((Not oRs.eof) And (RecordCount < oRs.PageSize)) %>
<% For Index=0 to (oRs.fields.count-1) %>
<% = oRs(Index)%> |
<% Next %>
<%
RecordCount = RecordCount + 1
oRs.MoveNext
Loop
%>
<%
oRs.close
oConn.close
%>