ADO CursorLocation Property

Definition and Usage

The CursorLocation property can set or return a long value that indicates the location of the cursor service. It can be set to CursorLocationEnum One of the values. The default value is AdUseServer.

The cursor is used for:

  • Control record positioning
  • Control the visibility of changes made to the database by other users
  • Control data upgradability

Note:The Recordset object will automatically inherit this setting from the associated connection.

Note:This property is read/write on Connection or a closed Recordset, and read-only on an open Recordset.

Syntax

objConnection.CursorLocation
objRecordset.CursorLocation

Example

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("northwind.mdb"))
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT * FROM Customers"
rs.CursorLocation=adUseClient
rs.CursorType=adOpenStatic
rs.LockType=adLockBatchOptimistic
rs.Open sql,conn
rs.Close
conn.Close
%>