cursorlocation可以设置成cluseclient或cluseserver
我想问一问这个有什么不同呢?
要是在多客户使用下,把数据控件设置成cluseserver
是每个客户端对同一个数据库共同使用一个游标呢?还是各个用户各自拥有自己的游标而对数据库的操作是互不相干的?

解决方案 »

  1.   

    参考 李维的 delphi 5.x Ado那本书
      

  2.   

    http://delphi.about.com/library/weekly/aa061201b.htm CursorLocation
    The CursorLocation property defines where the recordset is created when it's opened ?on the client or the server. The data in a client-side cursor is "inherently disconnected" from the database. ADO retrieves the results of the selection query (all rows) and copies the data to the client before you start using it (into the ADO cursor). After you make changes to your Recordset, the ADO translates those changes into an action query and submits that query to your database through the OLE DB provider. The client-side cursor behaves like a local cache. 
    In most cases, a client-side cursor is preferred, because scrolling and updates are faster and more efficient, although returning data to the client increases network traffic. Using the server-side cursor means retrieving only the required records, requesting more from the server as the user browses the data. Server-side cursors are useful when inserting, updating, or deleting records. This type of cursor can sometimes provide better performance than the client-side cursor, especially in situations where excessive network traffic is a problem. You should consider a number of factors when choosing a cursor type: whether you're doing more data updates or just retrieving data, whether you'll be using ADO in a desktop application or in an Internet-based application, the size of your resultset, and factors determined by your data store and environment. Other factors might restrict you as well. For example, the MS Access doesn't support dynamic cursors; it uses keyset instead. Some data providers automatically scale the CursorType and CursorLocation properties, while others generate an error if you use an unsupported CursorType or CursorLocation.