Solved

ADO related question

Posted on 2004-10-04
9
177 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:navinkaus
ID: 12216915
I have gone through the above link but it does't  give answer of my question
0
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 80
C++ BOOL WINAPI ReadFile fails on windows 10 when reading from USB cable 9 472
How to know only "File created" with EventLog 3 35
MaxSpan challenge 9 105
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

860 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