What is Cursors in DAODC


I don't understand what is a "Cursor" in DAODC, for example the CursorType property....It should not be the cursor of mouse :-)
Who is Participating?
RuchiConnect With a Mentor Commented:
the cursortype property determines the recordset type that is returned. the following types are:

constant           value   description
adopenforwardonly - 0 -  fast but forward only - default

adopenkeyset -   1 -   see some of the data changes by other users. (edits by other users are seen. records added or deleted by others are not seen)

adopendynamic - 2 - see all the data changes made by other users. (all adds, edits, and deletes by others are seen)

adopenstatic - 3 - cannot see other's changes. (static cursor recordset to find data only)
No, it is the pointer of the record-set to current record.
learnAuthor Commented:
To Gunsen :

Thank you.

But the CursorType has got nothing to do with the pointer to current record...:-(
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

The cursor is a navigator in the recordset.
CursorType is a cursor property holding a value describing how to navigate within the recordset.
A cursor in a recordset is like a cursor on a computer screen; it is a pointer to a current position.
learnAuthor Commented:
Adjusted points to 50
learnAuthor Commented:
To Ruchi:

According to my book, only three settings for the ADODC:

adOpenStatic - default, cannot edit data, no mention on other uses;
adOpenDynamic - can edit data, automatically reflects the data change by other uses;
adOpenKeyset - can edit data, can not see the change by other uses;

They are not 100% the same as what you showed in your comments :-(
What is the name of your book? Do you remember that you post the question regarding "Correct the code from a book"? In my opinion, your book sounds like it's not very good... Anyways, the comments I posted are from the book called Using Visual Basic 6 and notes from my class.

Let me read the MCSD book --

Working with Cursor Types -- ADODC

static cursor - the information cannot be modified, nor can additions or deletions be made to the cursor and of limited use in a data entry program.

Dynamic - enables you to modify the information in the cursor as well as add new records and delete existing records. any changes made by other users in a multi-userr environment are reflected in the cursor. this should be used in a  multi-user environment when each user needs to immediately see changes made to the database by other users. however, the dynamic cursor comes with a penalty of increased memory usage and network traffic when compared to the keyset.

Keyset - similiar to a dynamic cursor, except that changes, additions, and deletions by other users are not visible to you in the keyset until the key keyset is specifically refreshed. this should be used in a multi-user environment when changes to the database made by the users will have little or no impact on each other.
learnAuthor Commented:
To Ruchi :

My book is also a MCSD book!! I will tell you its full name later.

I think there is no big differences between my last comment and yours....except the "default"...or anything I misunderstood?

I have just tested that after setting CursorType to adOpenStatic I can still delete a record by

Yes, the default is a static cursor.

>>I have just tested that after setting CursorType to adOpenStatic I can still delete a record by ADODC1.Recordset.delete


Please post your code here..
learnAuthor Commented:
To Ruchi:

I will post the code, but that is too simple....

My book is:

Desktop applications
Michael McKelvy

The explalation for setting CursorType is in page 263.
The wrong example I asked last time is in page 268.
learnAuthor Commented:
To Ruchi:

The code is from the wrong example with your correction:

(SursorType of Adodc1 has been set to adOpenStatic.)

Private Sub Command2_Click()

    With Adodc1.Recordset
        If .EOF Then .MoveLast
    End With

End Sub
I don 't have that book you have mentioned. I have MCSD: Visual Basic 6 Desktop Application Study Guide. I have tested it, and the record is deleted!!!

But, if you set the LockType property to read-only, the record is not allowed to delete.

If you want to work with the database by using ADO, not ADODC, you cannot delete the record...  I am not good at explaining to you about ADO because I don't use it a lot. I use DAO all the time!!  

Please read MSDN library -- CursorType Property.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.