RowsAffected returns -1 when data exists

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Sendero Software
Posts: 1
Joined: Sun 02 Apr 2006 00:50

RowsAffected returns -1 when data exists

Post by Sendero Software » Sun 02 Apr 2006 00:58

I just download and installed the MyDAC 4.30.0.11 and when I issue a select statement that has results, RowsAffected is -1.

If I use RecNo or RecordCount the value is 1.

Is there a reason that RowsAffectect does not return the correct value of 1?

I also notice that when using DBMonitor or MySQLBuilder, it displays
a RowsAffected of 0 even when records are clearly displayed.

Using:
D7Pro
MySQL server version: 4.1.13-nt
MyDAC 4.30.0.11

Regards,
Scott.

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Sun 02 Apr 2006 09:18

RowsAffected is used when you use delete/update statments, it will indicate the number of rows affected (Deleted,updated...). In case of a select statment this doesn't have sense, you will have the RecordCount for this purpose.

RowsAffected is also nice to use when you have to insert or update a object.. First try update, if rowsaffected is 0, then you know that row doesn't exist and can perform a insert.

Post Reply