Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

ADO CursorLocation 属性


❮ Recordset 对象完整参考

CursorLocation 属性设置或返回一个长整型值,该值指示游标服务的所在位置。它可以设置为 CursorLocationEnum 值之一。默认值为 AdUseServer。

游标用于

  • 控制记录导航
  • 控制数据库中更改的可见性
  • 控制数据的可更新性

注意:Recordset 对象从关联的 Connection 对象继承此设置。

注意:此属性在打开的 Recordset 对象上为只读,在 Connection 对象或关闭的 Recordset 对象上为读写。


语法

objConnection.CursorLocation

objRecordset.CursorLocation

示例

<%
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
%>

CursorLocationEnum 值

常量 描述
adUseNone 1 已过时(仅为向后兼容而存在)。不使用游标服务
adUseServer 2 默认值。使用服务器端游标
adUseClient 3 使用本地游标库提供的客户端游标。为了向后兼容,还支持同义词 adUseClientBatch

❮ Recordset 对象完整参考
×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.