Board index » delphi » Getting Rows Affected when doing an Open
Ron Oskam
![]() Delphi Developer |
Wed, 16 Jun 2004 01:45:35 GMT
Getting Rows Affected when doing an Open
I have a ADOQuery object that I'm using to run a query. This query could be
an action query or return data. Not only that but it could be connected to any one of a wide variety of kinds of databases (SQL Server, Access etc). The problem is that if an action query is run I want to know the number of rows affected. If I could determine if the query was an action query I could call the ExecSQL method which returns the rows affected. However, if we're connected to SQL Server, some stored procedures return data in the form of a table. If that's the case then I'd want to call the Open method to display the data. If I run an action query using Open, the command will execute, even though it errors out. So I can tell what kind it is after I run the query, but running the query twice is not an option. There is a RowsAffected property but that remains 0 when I run an action query this way. Anyone? Anyone? Ron Oskam |