Thread: v7.01.00.07 driver fails to properly report BOOL values using CRecordsets (VC++)

v7.01.00.07 driver fails to properly report BOOL values using CRecordsets (VC++)

From
Kristis Makris
Date:
Hello all,

I took the v7 driver for a test drive and it looks like it properly
reports all referential integrity errors reported from the backend (this
was a bug in the v6). Kudos to the devel team; you guys are doing a
superb job hunting down and fixing those bugs :)

I did come across something peculiar though. It seems to me that ever
since I updated to the v7, the driver incorrectly reports the BOOL
values retrieved from the backend. I first noticed this (?bug?) in the
following snippet of code using VC++ and a CRecordset object.


**********************************************************************
strStmt = "SELECT someBackendFunctionThatReturnsBOOL('someTextValue') AS
answer";
rsSelect.Open(CRecordset::forwardOnly, strStmt);

 if (db.CanTransact())
   db.BeginTrans();

  while (!rsSelect.IsEOF())
    {
      rsSelect.GetFieldValue("answer", vID, SQL_C_SSHORT);

      rsSelect.MoveNext();
    }
**********************************************************************

After going through the debug mode of Visual Studio using both the v6
and v7 drivers I verified that the value of vID.m_iVal was set to 1 if
the BOOL return value was true and 0 if false using the v6 (and probably
older versions v5, v4). Now the vID.m_iVal is always set to 0,
regardless of the return value of the backend function. Maybe I'm using
the wrong fieldType (SQL_C_SSHORT); how do other VC++ users retrieve
BOOL values using a CRecordset? Did anybody else come across this
problem?

Thanks,
-Kristis



Re: v7.01.00.07 driver fails to properly report BOOL values

From
Hiroshi Inoue
Date:
Kristis Makris wrote:
>
> Hello all,
>
> I took the v7 driver for a test drive and it looks like it properly
> reports all referential integrity errors reported from the backend (this
> was a bug in the v6). Kudos to the devel team; you guys are doing a
> superb job hunting down and fixing those bugs :)
>
> I did come across something peculiar though. It seems to me that ever
> since I updated to the v7, the driver incorrectly reports the BOOL
> values retrieved from the backend. I first noticed this (?bug?) in the
> following snippet of code using VC++ and a CRecordset object.
>
> **********************************************************************
> strStmt = "SELECT someBackendFunctionThatReturnsBOOL('someTextValue') AS
> answer";
> rsSelect.Open(CRecordset::forwardOnly, strStmt);
>
>  if (db.CanTransact())
>    db.BeginTrans();
>
>   while (!rsSelect.IsEOF())
>         {
>           rsSelect.GetFieldValue("answer", vID, SQL_C_SSHORT);
>
>           rsSelect.MoveNext();
>         }
> **********************************************************************
>
> After going through the debug mode of Visual Studio using both the v6
> and v7 drivers I verified that the value of vID.m_iVal was set to 1 if
> the BOOL return value was true and 0 if false using the v6 (and probably
> older versions v5, v4). Now the vID.m_iVal is always set to 0,
> regardless of the return value of the backend function.

Oops it's my fault sorry.
I would fix it ASAP.

Thanks for the report.
Hiroshi Inoue