Chris Wiegand | 15 Jun 2005 02:15

Possible bug in FetchField for MSSQL driver?

I think I've found a bug related to function _adodb_getupdatesql, file
adodb-lib.inc.php, version 465, around line 492. I've added some echo
statements to the code below to help me figure this out:

    echo print_r($rs,true);
                // Loop through all of the fields in the recordset
                for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++) {
                        // Get the field from the recordset
                        $field = $rs->FetchField($i);

                        // If the recordset field is one
                        // of the fields passed in then process.
                        $upperfname = strtoupper($field->name);
                        echo "<BR>upperfname = $upperfname";
                        if (adodb_key_exists($upperfname,$arrFields,$force))
{

 
I consistently am getting false/blank for $upperfname, and it's therefore the
function's not working. But a print_r($rs) gives plenty of fields, as shown
below. Actually, I'm starting to think the error is in the FetchField()
function for mssql, since it's what appears to be returning false/blank, but
I can't seem to find mssql_fetch_field in any of the files.

adorecordset_mssql Object ( [dataProvider] => native [fields] => Array (
[Payer] => 116 [PayerType] => 1 [RequiresValidReferral] => 1 [PayerAccountID]
=> 1161 [InitReferralsAutoApproved] => 1 [NOCReferralsAutoApproved] => 1
[Switch2AFSMonth] => 4 [Switch2PayerAccountID] => 0
[RequireReportsBeforeServices] => 1 [ReferralsEnabled] => 1
[CWRequireTrailsCaseID] => 0 [PayerAccountName] => Denver County
(Continue reading)

Chris Wiegand | 15 Jun 2005 19:14

RE: Possible bug in FetchField for MSSQL driver?

Never mind. I was calling in my part of the code an auditlog function (which
used a new connection), however, apparently the mssql driver doesn't use
NConnect (according to the documentation), so it was trying to re-use the
connection (which worked weirdly enough) but which also made the
$rs->_queryID useless. So cancel this report.

Chris Wiegand
Network Administrator / Programmer
Signal Behavioral Health Network
Ph: 303.639.9320 x1016 

-----Original Message-----
From: Chris Wiegand 
Sent: Tuesday, 14 June, 2005 6:15 PM
To: 'adodb-general <at> lists.sourceforge.net'
Subject: Possible bug in FetchField for MSSQL driver?

I think I've found a bug related to function _adodb_getupdatesql, file
adodb-lib.inc.php, version 465, around line 492. I've added some echo
statements to the code below to help me figure this out:

    echo print_r($rs,true);
                // Loop through all of the fields in the recordset
                for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++) {
                        // Get the field from the recordset
                        $field = $rs->FetchField($i);

                        // If the recordset field is one
                        // of the fields passed in then process.
                        $upperfname = strtoupper($field->name);
(Continue reading)


Gmane