Solved

What is Cursors in DAODC

Posted on 2000-02-14
13
341 Views
Last Modified: 2010-05-02
Hi,

I don't understand what is a "Cursor" in DAODC, for example the CursorType property....It should not be the cursor of mouse :-)
0
Comment
Question by:learn
  • 6
  • 5
  • 2
13 Comments
 
LVL 3

Expert Comment

by:Gunsen
ID: 2518666
No, it is the pointer of the record-set to current record.
0
 

Author Comment

by:learn
ID: 2518711
To Gunsen :

Thank you.

But the CursorType has got nothing to do with the pointer to current record...:-(
0
 
LVL 3

Expert Comment

by:Gunsen
ID: 2518823
The cursor is a navigator in the recordset.
CursorType is a cursor property holding a value describing how to navigate within the recordset.
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2519416
A cursor in a recordset is like a cursor on a computer screen; it is a pointer to a current position.
0
 
LVL 9

Accepted Solution

by:
Ruchi earned 50 total points
ID: 2519454
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)
0
 

Author Comment

by:learn
ID: 2523037
Adjusted points to 50
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:learn
ID: 2523038
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 :-(
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2523496
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.
0
 

Author Comment

by:learn
ID: 2523643
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
ADODC1.Recordset.delete
Why?
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2523703
Learn,

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

Really?

Please post your code here..
0
 

Author Comment

by:learn
ID: 2523728
To Ruchi:

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

My book is:

MCSD TEST SUCCESS
VISUAL BASIC 6
Desktop applications
Michael McKelvy

The explalation for setting CursorType is in page 263.
The wrong example I asked last time is in page 268.
0
 

Author Comment

by:learn
ID: 2523763
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
        .Delete      
        .MoveNext      
        If .EOF Then .MoveLast
    End With

End Sub
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2524723
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need VBS version of Excel date conversion 4 65
Windows Script Host failed (Access is denied.) error 6 109
using web browser with BING 40 111
Visual Studio 2005 text editor 10 35
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now