whpgabesz
asked on
Rows affected after update
I am using delphi adocommand to update a table.
For example :
adocommand.commandtext := 'Update table set something = 'green'';
How can I get back the affected rows?
I am using ms Sql 2005.
Please write an example.
Thanks
For example :
adocommand.commandtext := 'Update table set something = 'green'';
How can I get back the affected rows?
I am using ms Sql 2005.
Please write an example.
Thanks
ASKER
Can you write an example?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can do...
adocommand.commandtext := 'Update table set something = 'green'';
adocommand.ExecSQL;
YourRowsAffected := adocommand.RowsAffected;
or shorter
adocommand.commandtext := 'Update table set something = 'green'';
YourRowsAffected := adocommand.ExecSQL;
adocommand.commandtext := 'Update table set something = 'green'';
adocommand.ExecSQL;
YourRowsAffected := adocommand.RowsAffected;
or shorter
adocommand.commandtext := 'Update table set something = 'green'';
YourRowsAffected := adocommand.ExecSQL;
ASKER
It was an excellent answer. Thanks
it has a property RowsAffected for this