Posts: 3
Threads: 1
Joined: Jul 2009
Reputation:
0
07-26-2009, 11:56 AM
Hi,
I tried to get the count from some table but didn't suceed.
One of my colleague asked me to add the following lines in DB Connection query:
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Can anybody please explain what are these variables and why do we need to add these constant variables.
Thanks,
Mona
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
07-27-2009, 10:00 AM
These are the cursors which controls the navigation of records in a recordset and how the records will be updated.
I have tried to explain this, hope this will help you
adOpenForwardOnly - this is the default cursor if no other is specified. This cursor allows only forward movement through a recordset
adOpenKeyset - this cursor supports forwards as well as backwards navigation. It also allows you to update a recordset and all changes will be reflected in other users recordsets. The cursor also supports bookmarking
adOpenDynamic - this cursor supports forward and backward navigation but bookmarks may not be supported (ie Access). Any changes made to data are immediately visible with no need to resynchronise the cursor with the database
adOpenStatic - this cursor uses a static copy of data from the database and therefore no changes to the data are visible and supports forward and backward navigation
adUseClient - using this cursor recordset will be in read only mode i.e. the recordset cannot be used to update records in the database. A recordset with the CursorLocation asUseClient is typically used when an active Recordset is Disconnected for viewing data.
The locktype parameter specifies which type of locking should be used on the cursor when editing data in a recordset
adLockReadOnly - default type used when no locktype is specified
adLockPessimistic - forces the database to lock the entire record when editing first starts
adLockOptimistic - locks records only after you call the UPDATE method of the recordset object
adLockBatchOptimistic - allows batch updating instead of updating each record individually
Posts: 3
Threads: 1
Joined: Jul 2009
Reputation:
0
07-27-2009, 01:06 PM
Hi Saket,
Thank you very much for answering my query.
It would be realy helpful if you can give me any link or tutorial which can help me understand this better, like which cursor to be used and when.
Thanks,
Mona
Posts: 3
Threads: 1
Joined: Jul 2009
Reputation:
0
07-27-2009, 02:16 PM
Hi Saket,
I appreciate the time you took to answer my questions...
Have a Good Day...
Thanks,
Mona