Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ADO related question

Posted on 2004-10-04
9
Medium Priority
?
183 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
[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
  • 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
Technology Partners: 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!

 

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 800 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

610 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