Requery vs command.execute 
Author Message
 Requery vs command.execute

Urgent Need Your Help.

I found that whenever command.execute is performed (to insert a record by
using INSERT INTO), the time is always delayed for quite a while.  Since my
next statement is to perform the sum of all records including the new
record, and the result is always showing the sum of  all records excluding
the new one.

I have tried to use .Requery and it can only take effect if I execute the
requery in a loop for 100 times.
Can anyone give me some hint on how to make the command.execute with
immediate effect?

With Best regards,
Herbert



Sat, 23 Oct 2004 21:32:07 GMT  
 Requery vs command.execute
If you are using JET, you could import the Jet library and call the Flush
Cache method. Also try reducing the PageTimeout property in your registry
(it is in milliseconds).

==
Flush cache and Jet registry can be experimented with using
http://www.adoanywhere.com/download/aaBrowse2_7.zip
==
--
Michael Collier Bsc (Hons)
Interactive ADO Object Browser
www.adoanywhere.com

--


Quote:
> Urgent Need Your Help.

> I found that whenever command.execute is performed (to insert a record by
> using INSERT INTO), the time is always delayed for quite a while.  Since
my
> next statement is to perform the sum of all records including the new
> record, and the result is always showing the sum of  all records excluding
> the new one.

> I have tried to use .Requery and it can only take effect if I execute the
> requery in a loop for 100 times.
> Can anyone give me some hint on how to make the command.execute with
> immediate effect?

> With Best regards,
> Herbert



Mon, 25 Oct 2004 10:26:57 GMT  
 Requery vs command.execute

Hi Mike,

Thanks for your help.
Yes, I am using Microsoft JET 4.0 with ADO 2.6.
I could only find the context of ADODB.stream which has the method of
flush.  
So I have tried the following...

Dim Rs as ADODB.Recordset
Dim strSQL1 as string
Dim stm as ADODB.stream

set stm = new ADODB.stream
set Rs = new ADODB.Recordset

   strSQL1 = "Select * from InvoiceDetail where InvoiceNo = '" &
txtInvoiceNo & "' AND Status = 1 ORDER BY SeqNo"

   Rs.Open strSQL1, db, adOpenDynamic, adLockOptimistic

   stm.Open Rs, adModeRead, adOpenStreamFromRecord

  ....

 after completion,

  stm.flush

But it always failed in the
stm.Open Rs, adModeRead, adOpenStreamFromRecord

Arguments are of wrong type, are out of acceptable range, or are in
conflict of one another

I wonder if you have an example for using flush.

With many thanks,
herbert

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 25 Oct 2004 13:43:40 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. command.execute vs. connection.execute

2. Command Object VS execute sql

3. Conn.Execute vs. Command Object w/Oracle

4. Execute command, client vs server

5. Connection.Execute vs. Recordset.Open or Command.Open

6. qdf.Execute vs. db.Execute

7. ADO: cmd.Execute vs cn.Execute

8. Executing a Requery Asynchronously

9. command.execute didn't get executed sometimes

10. How to execute a command line command from a *.HTA

11. Using the ADO Command Object to send an Execute command

12. Executing command to command line from VB App

 

 
Powered by phpBB® Forum Software