Solved

ADO related question

Posted on 2004-10-04
9
174 Views
Last Modified: 2013-11-20
Hi All,
        If I use command object and then execute the query , recordset returned by execute method is fast compare to calling open method of recordset with following parameters  Open("mast_sntlc_essence",vNull, adOpenStatic, adLockOptimistic, adCmdTable);      

      Could you tell me why one recordset which is returned by execute method of command object is fast compare to recordset with open method.

      Could you provide me any link or material which can tell me what are various parameters to use in diffenent condition ( add,modify,display,delete ) to a large database so that operation will be faster.        
0
Comment
Question by:navinkaus
  • 4
  • 3
  • 2
9 Comments
 
LVL 6

Expert Comment

by:Amritpal Singh
ID: 12216327
a related (but not exact) article at the followin link
plz have a look

http://support.microsoft.com/default.aspx?scid=kb;en-us;q126131
0
 

Author Comment

by:navinkaus
ID: 12216367
Thanks for your prompt reply but I am looking for ADO not ODBC
0
 
LVL 6

Expert Comment

by:Amritpal Singh
ID: 12216872
0
 

Author Comment

by:navinkaus
ID: 12216915
I have gone through the above link but it does't  give answer of my question
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 6

Expert Comment

by:Amritpal Singh
ID: 12224001
ok no probs
0
 
LVL 2

Accepted Solution

by:
bcsonka earned 200 total points
ID: 12233729
Hi,

The Execute method's default cursor is forward-only/read-only.  The method that you are trying to execute with the _RecordsetPtr instance [Open("mast_sntlc_essence",vNull, adOpenStatic, adLockOptimistic, adCmdTable);] has a static/optimistic lock, however.  Static/Optimistic cursors use more resources than Forward-Only/Read-Only cursors, which is why the two methods have a performance difference.  Change your Open method to:

Open("mast_sntlc_essence",vNull, adOpenForwardOnly, adLockReadOnly, adCmdTable);

If I'm not mistaken, the performance of _RecordsetPtr's Open method should now be comparable to the _CommandPtr's Execute method.

I hope that helps.

0
 

Author Comment

by:navinkaus
ID: 12233942
Excatly I found the same answer on google. Please have a look on following link it helped me alot.

http://www.4guysfromrolla.com/webtech/062799-3.report.shtml.
http://www.4guysfromrolla.com/webtech/112998-1.shtml

Could you just tell me which type of parameters we should use for following 4 methods. My thinking suggest for following things .

1. Add      ( through query )  command object
2. Modify  ( adOpenStatic, adLockOptimistic )
3. Delete  ( through query )  command object
4. Display ( adOpenForwardOnly, adOpenReadOnly,...)


  Just tell me the good and optimise way for above four methods.
0
 
LVL 2

Expert Comment

by:bcsonka
ID: 12242921
Hi,

For add, update, and delete queries, you can use static/optimistic cursors but it really all depends on your requirements and what you're coding towards.  For select queries, forward-only/read-only is usually the way to go if you are just doing a once-through for the recordset.
0
 

Author Comment

by:navinkaus
ID: 12245342
Hi Bcsonka,
               I want to avoid static/optimistic cursors since just imagine you want to add new record then why should you waiste your time in creating recordset with static/optimistic it takes time instead you directly fire the query
0

Featured Post

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).

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

708 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

14 Experts available now in Live!

Get 1:1 Help Now