number of rows updated 
Author Message
 number of rows updated

How to find out how many number of rows updated using SQL update statement
using ADO on vc++


Wed, 20 Oct 2004 16:03:00 GMT  
 number of rows updated
veeruchowdary

You can usethe Command.Execute method, and the first argument is a ref to a
variant, and upon return, it will contain the value returned by the rdbms.

If you are using #import syntax and smartpointers, try something like this:

cmd->CommandText = L"Update table set TimeZone = 'PST' where State
in('CA','OR','WA') ";
_variant vrRowCnt;
cmd->Execute(&vrRowCnt,NULL,adCmdText);
int iRowCnt = (long)vrRowCnt;

The following links to MSDN Library will describe the Command.Execute method,
and the RecordsAffected argument, as well as the C++ and C++ #import syntax.  In
the documentation on the Execute method, the first argument is described as a
LONG - and indeed it is, but it is returned in a VARIANT.  The #import wrapper
methods change that to the automation class _variant_t.

http://msdn.microsoft.com/library/en-us/ado270/htm/mdmthcmdexecute.asp

http://msdn.microsoft.com/library/en-us/ado270/htm/mdidxcommandvcimpo...

 http://msdn.microsoft.com/library/en-us/ado270/htm/mdidxcommandvcppsy...

i hope this helps.
best regards
Roy Fine


Quote:
> How to find out how many number of rows updated using SQL update statement
> using ADO on vc++



Wed, 20 Oct 2004 23:15:44 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. single row updates effect multiple rows....

2. Q: Error message "Multiple rows updated"???

3. No rows were updated pb

4. Problem locking a row for updating

5. Insert, Update, Delete of rows using OLE DB ATL Consumer Templates

6. Low-level API calls, How to update a row

7. ODBC: "Multiple rows were updated" ERROR

8. SQLOLEDB Provider Row Updates

9. how to update rows with _RecoderSet?

10. Can't update row data with SQLSetPos

11. Updating bulk rows of data

12. OLE DB: Error update row

 

 
Powered by phpBB® Forum Software