Solved

What is Cursors in DAODC

Posted on 2000-02-14
13
360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

691 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