Execution of Procedure: EXECUTE method or Command object ?

Execution of Procedure: EXECUTE method or Command object ?

Post by Niko » Sat, 16 Sep 2000 15:06:33



Hi,
Using VB6 and SQL7, is there a difference between the execution of a
procedure with the Execute method
and the execution of the same procedure with a Command object ?

Thank you
Nicolas

 
 
 

Execution of Procedure: EXECUTE method or Command object ?

Post by Carlos Eduardo Roja » Sat, 16 Sep 2000 04:00:00


The execute method is easier, but the command object is more efficient
because it only does a roundtrip to the database server.
--
Hope this helps,
--------------------------------------
Carlos Eduardo Rojas
MCSE+I, MCDBA, MCSS

Quote:> Hi,
> Using VB6 and SQL7, is there a difference between the execution of a
> procedure with the Execute method
> and the execution of the same procedure with a Command object ?

> Thank you
> Nicolas


 
 
 

Execution of Procedure: EXECUTE method or Command object ?

Post by Niko » Sat, 16 Sep 2000 04:00:00


Yes and thank you.
What is exactly the difference since we execute a strored procedure anyway ?
What is this second roundtrip that you mean ?

Nicolas

 
 
 

Execution of Procedure: EXECUTE method or Command object ?

Post by Carlos Eduardo Roja » Sat, 16 Sep 2000 04:00:00


Take a look at this kb article in support.microsoft.com: Q174223
--
Hope this helps,,
---------------------------------------------------
Carlos Eduardo Rojas
MCSE+I, MCDBA, MCSS


Quote:> Yes and thank you.
> What is exactly the difference since we execute a strored procedure anyway
?
> What is this second roundtrip that you mean ?

> Nicolas

 
 
 

Execution of Procedure: EXECUTE method or Command object ?

Post by Niko » Sun, 17 Sep 2000 15:24:30


I have read the article and it maybe partially explains what I was asking.
I was not comparing the parameter definition method with the refresh method
with but with this one:

cnx.Execute "EXECUTE sp_MystoredProc prm1val1, prm2val2, .."

I made some elementary timing tests between these two and I really did not
find any significant difference.  But maybe I am also wrong....  It is much
more easier to code but I wouldn't take the risk to use it if it could
become a pitfall.

And again thanks
Nicolas

 
 
 

1. ADO Command object Execute method

Hi,

A year ago I created a class with VB6. To this class I pass an ADO
connection.  Recently I added a code to this class that executes a delete
query in Access 97 database through use of ADO command object and it works.

However, if I now create a NEW class and add the same code I am no longer
able to execute the same code (run a delete query in Access database)  from
within the new class.
The error message I get is"Invalid SQL statement, excpected
'DELETE','INSERT', 'PROCEDURE', 'SELECT', OR 'UPDATE'

Thanks,
Predrag

2. Is there any possible way to print a VB data grid?

3. Need help with Execute method of Command object

4. Truncate table vs drop table and fragmentation

5. XSLT transform using Inline Schemas

6. accessing stored procedure return value using ADO (2.0) command execute method

7. P.sql 7 client with P.sql 2000 server?

8. ? Executing a Stored Procedure With Output Parameters and A Resul tset using a Command Object

9. Stored Procedure execute twice through command object (2 spid in SQL)

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

11. ADO & Locktype for Command.Execute method

12. DataEnvironment - Changing ADO Command Execute method parameters