odbcconn.Execute and SQL_NO_DATA lazarus / 16-Databases ---------------------------------------------------------------------- Lacak2 · 2009-04-21 11:03 MSDN: If SQLExecute executes a searched update or delete statement that does not affect any rows at the data source, the call to SQLExecute returns SQL_NO_DATA. But ODBCCheckResult throws exception, because in ODBCSucces we do not handle SQL_NO_DATA as success. So I am unable to run sql statement that, does not affect any rows without throwing exception. What about adding " or (Res=SQL_NO_DATA)" into ODBCSucces or into ODBCCheckResult ? TIA -Laco. ---------------------------------------------------------------------- Loesje · 2009-04-21 17:33 I don't think it's ok on all places where ODBCSucces is called. See if you can find out. ---------------------------------------------------------------------- LacaK · 2009-04-22 06:57 I searched MSDN for return values of ODBC API functions. If I am correct, there are only this functions (used in odbcconn.pas), which can return SQL_NO_DATA: 1. SQLDriverConnect - If the user cancels a dialog box presented by the Driver Manager or the driver - so this is not success 2. SQLGetData - when retrieving Variable-Length Data in Parts and no more data is available - this should be handled into code, if not it may indicate error 3. SQLFetch - expected and handled 4. SQLExecute - expected, not handled correctly So I think, that we can handle this without touching ODBCCheckResult or ODBCSucces ... in Execute method. Please look at attached file. -Laco. ---------------------------------------------------------------------- Loesje · 2009-04-22 08:21 Can't you make a normal patch? ---------------------------------------------------------------------- Lacak2 · 2009-04-22 12:35 It was not intended as a patch only as a proposed solution for considering. Although I have no experience with SVN and SVN utils, so I am not able to prepare such patch (withou installing soem SVN and downloading Lazarus from SVN). I can make only diff between original file and my modification (but I do not known if it is sufficient and if it is correct patch or not). So diff will help ? ---------------------------------------------------------------------- Loesje · 2009-04-24 22:07 Yes, a diff is what I want. (Diff -u) That's not because I want to apply it directly to svn, but I'm used to read diff's, it's much easier to see what has been changed in a diff, then when you have to compare two text-blocks which each other. (With a diff I can judge it immediately, I don't even need to lookup the original code, because that's also in the diff) ---------------------------------------------------------------------- LacaK · 2009-04-27 06:22 ok, here are two diffs. One build using Lazarus , second using cygwin diff. hope this help. Do you prefer also fill bug report in mantis bug tracker ?