Name
AbsolutePosition (Recordset Object) —
rsObj
.AbsolutePosition (=
lngRecordPosition
)
Synopsis
Returns or sets the current record based on its ordinal position in the recordset. This is a read/write value of type Long.
Parameters
-
rsObj A reference to a Recordset object
-
lngRecordPosition The position of the current record or the new position to which you wish to move the record pointer
Example
The following example demonstrates the use of the AbsolutePosition property. The use of AbsolutePosition is in bold to distinguish it in this example. The other parts of the script will be used to demonstrate other parts of ADO. Also, in the following example, you will notice that I am careful not to specify my data provider. The reason for this is that only some data providers support the AbsolutePosition property; for example, SQL Server does not.
<%@ LANGUAGE="VBSCRIPT" %> <%response.buffer = true%> <HTML> <HEAD> <TITLE>ADO Examples</TITLE> </HEAD> <BODY> <% ' Include ADOVBS.INC so we can use the ADO constants. %> <!-- #include virtual = "/MySSIncludes/adovbs.inc" --> <% ' Instantiate an ADO Connection object. Set objDBConn = Server.CreateObject("ADODB.Connection") ' Construct the connection string for the Connection object strConn = _ "driver={MyDBType};;uid=sa;pwd=;database=SalesDB" ' Using the connection string, open the connection. objDBConn.Open strConn ' Instantiate an ADO Recordset object. Set rsHighSales = _ Server.CreateObject("ADODB.Recordset") ' Set the CursorType property of the ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access