Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why Constant Variables while connecting to DB
#1
Solved: 11 Years, 4 Months ago
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
Reply
#2
Solved: 11 Years, 4 Months ago
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

Reply
#3
Solved: 11 Years, 4 Months ago
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
Reply
#4
Solved: 11 Years, 4 Months ago
Hi Mona,

PLease follow the link
http://dev.mysql.com/tech-resources/arti...locks.html


Thanks,
~Saket

Reply
#5
Solved: 11 Years, 4 Months ago
Hi Saket,
I appreciate the time you took to answer my questions...
Have a Good Day...
Thanks,
Mona
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Function That Creates WebLink Variables Eitel13 3 1,505 07-17-2018, 03:25 PM
Last Post: Ankur
  Array as User-Defined Environment Variables Arena 3 4,274 04-16-2012, 09:19 AM
Last Post: sshukla12
  programming to use different external file of environment variables bundfromnj 1 3,979 01-19-2012, 05:32 PM
Last Post: SteveS
  How to store all output values in different variables Jyobtech 4 4,755 10-13-2010, 11:23 AM
Last Post: KavitaPriyaCR
  Using DP with variables pjeigenn 6 4,517 07-19-2010, 07:32 PM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)