 |
chintu4u Level: Graduate
 Registered: 22-03-2006 Posts: 11
|
Re: ADO Connection
Thank you for reply Mr. Goran .
But can you give more clear idea regarding it and
what is the difference between ADODC and ADODB.
Give me some full examples for it..
Thank you in advance..
|
|
23-03-2006 at 12:51 PM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: ADO Connection
I believe the best think to do is read some begginers book about ADO. Answers to a few questions will only open a 1000 more. From the questions you are asking, I see that you dont know nothing about ADO (you did said that you are a begginer), so you wont learn much about ADO this way, and this approach will only keep you more confused.
So, find a ebook on a net, and spend a day or two reading it, and all will be much clearer.
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
23-03-2006 at 02:33 PM |
|
|
chintu4u Level: Graduate
 Registered: 22-03-2006 Posts: 11
|
Re: ADO Connection
Mr. Goran, as you say I gone through some website and now I got idea regarding ADO.Now can u help me for the cursor types and Lock types. Good u give easy reference to understand it..
|
|
30-03-2006 at 12:48 PM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: ADO Connection
There where many excellent articles on net about cursors, but seems that all of them are charging to read them. Let me try to explain in short:
Cursor: It is something that is used for record navigation (move to previous/next record), to update data, and to allow you to see changes made to data by other users.... in simpler form, when you return data in a recordset, it allows oyu to browse data and to know the current position in a recordset you are browsing.
Cursor type
There are 4 types of cursors: adOpenDynamic, adOpenKeyset, adOpenStatic and adOpenForwardOnly.
When we talk about cursor type, we talk about what type of movement is allowed - ex whether we can make to move backward to recordset or only forward, whether we can return the number of records (RecordCount property). Cursor type also determines whether we can see the changes to data made by other users.
All this functionalities can be but doesnt need to be supported by one cursor. The reason for this is because a cursor carries with it some overheat when used, which affects application performance. The more functionallity it supports, the more overheat it carries. Lets say that you need to return some data in a recordset, and you need to determine which cursor type you will use. If data is only for displaying (read-only data), then our choice should be forward only cursor, not dynamic cursor. The difference in speed executinn will be quite big.
adOpenDynamic cursor
It carries the biggest overheat. It 'notifies' us (allow us to see) about added, changed and deleted records by other users, and allows all types of movement through the recordset.
adOpenKeyset cursor
Similar to dynamic cursor, except that it only allow us to see the changes to records made by other users. It doesnt inform us about added or deleted records by other users. It also allows all types of movement through the recordset.
adOpenStatic cursor
This cursor doesnt allow us to see changes to records by other users, nor does it notify us about added/delteted records. For this reason, it carries much less overheat that the 2 cursors above. As dynamic and keyset cursors, It providesss all types of movement through the records.
adOpenForwardOnly cursor
Default cursor. It is identical to a static cursor except that you can only move forward through records. This will improve performance when you only need to loop through data.
LockType
This type tells the provider (we communicate with provider when we want to do something with data) how records should be locked when we are changing data. Locking data can prevent one user from reading data (or changing data) that is being changed by another user.
There are 4 types of locks: adLockOptimistic, adLockPessimistic, adLockReadOnly and adLockBatchOptimistic.
adLockOptimistic lock type
With this type of locking, records are locked only when Update method is called.
adLockPessimistic lock type
This locks record immediately after the record is edited. This ensures succesfull editing.
adLockReadOnly lock type
Default lock. This type of lock doesnt allow data editing. This lock type is used when we want to only display data, and is extremely fast.
adLockBatchOptimistic lock type
This type of lock is usually used with with disconnected recordsets. These recordsets are updated locally and all modifications are sent back to the database in a batch.
[Edited by Goran on 31-03-2006 at 12:17 PM GMT]
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
31-03-2006 at 11:15 AM |
|
|
|
|
 |
 |