From 76145bb52f0cc1c659f08574fede3183ee3135ae Mon Sep 17 00:00:00 2001 From: Mark Newnham Date: Sun, 31 May 2020 18:57:48 -0600 Subject: Retrieve error messages early before connection close #614 Error messages from last error are lost if the connection is closed before retrieval --- drivers/adodb-mssqlnative.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/adodb-mssqlnative.inc.php b/drivers/adodb-mssqlnative.inc.php index 53be16ce..1f48a32f 100644 --- a/drivers/adodb-mssqlnative.inc.php +++ b/drivers/adodb-mssqlnative.inc.php @@ -1080,6 +1080,12 @@ class ADORecordset_mssqlnative extends ADORecordSet { is running. All associated result memory for the specified result identifier will automatically be freed. */ function _close() { + /* + * If we are closing down a failed query, collect any + * error messages. This is a hack fix to the "close too early" + * problem so this might go away later + */ + $this->connection->errorMsg(); if(is_resource($this->_queryID)) { $rez = sqlsrv_free_stmt($this->_queryID); $this->_queryID = false; -- cgit v1.3