Solved

ADO .Requery

Posted on 2002-05-06
5
527 Views
Last Modified: 2010-05-02
    I think I know what .Requery does ... it effectively closes and re-opens the table ... and I believe I know when you have to use it.
 
     If 3 consecutive .Seeks fail, you get this bogus ADO error: "Row handles must all be released before new ones can be obtained." Issuing a .Requery before the .Seek makes this problem go away.
 
     I've probably overkilled the problem by issuing a .Requery before every .Seek. I assume there is a performance penalty for this, but have no idea what it is, if anything.
 
     My question: Other than this rather exotic use ... effectively a kludge to avoid a known ADO bug ... what is the purpose of .Requery? Am I paying much for over-using it?
0
Comment
Question by:GebhartBob
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:ramani_gr
ID: 6993263
0
 
LVL 1

Accepted Solution

by:
barendb earned 100 total points
ID: 6993999
Requery is used to get recordset updates in a multi-user system on a persistent connection.  I don't think you are taking a major performance hit, unless your server is already extremely busy.  Then it will affect the server and LAN traffic.
0
 

Author Comment

by:GebhartBob
ID: 6998018
barendb---
 
     Thanks for your input.
 
     I know what "a multi-user system on a persistent connection" is, but don't understand what you mean when you say, "Requery is used to get recordset updates". Can you clarify this for me?
0
 
LVL 1

Expert Comment

by:barendb
ID: 6998198
When a user makes changes, it will be written to the database on the server, but the other users on the system will not automatically see these changes.  The other users will only see these changes after doing a requery.

Regards
Barend
0
 

Author Comment

by:GebhartBob
ID: 7000403
    You learn something new every day. Thanks very much for taking the time to reply.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

786 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