Page 1 of 1

Problem with DBXCommand_GetRowsAffected() in dbexp4

Posted: Thu 11 Aug 2016 15:35
by NickoP
There is a TSQLConnection and a TSQLQuery using it to select some data from a MS SQL Server database. If the connection is closed, and after that we perform cleanup of the query (query.SQL.Clear()), an AccessViolation exception is produced in the DBXCommand_GetRowsAffected() method, because the Handle parameter is not checked before usage. This is reproduced regardless of whether the query is closed before the Clear() or not.
The sample code in Delphi (XE8 in our case) is:

Code: Select all

Q.Close();
Q.Prepared := False;
Q.SQL.Clear();
Version 7.2.4 of the driver is used and the exception is raised in unit dbexp4.pas, method DBXCommand_GetRowsAffected(Handle: TCRSQLObject; out Rows: Int64): TDBXErrorCode;
The same code works fine if the Interbase/Firebird driver (dbxida v.4.8.12) is used - no exception is produced.

Re: Problem with DBXCommand_GetRowsAffected() in dbexp4

Posted: Fri 12 Aug 2016 12:58
by ViktorV
Unfortunately, we couldn't reproduce the issue. To ivestigate the issue, please compose a small sample reproducing the issue and send it to viktorv*devart*com , including scripts to create database objects.