Solved

What is Cursors in DAODC

Posted on 2000-02-14
13
338 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
Comment Utility
No, it is the pointer of the record-set to current record.
0
 

Author Comment

by:learn
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Adjusted points to 50
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:learn
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

744 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

15 Experts available now in Live!

Get 1:1 Help Now