- Timestamp:
- 09/26/13 15:41:49 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.5.1-evolucao/phpgwapi/inc/adodb/drivers/adodb-odbc.inc.php
r34 r8222 1 1 <?php 2 2 /* 3 V 4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.3 V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved. 4 4 Released under both BSD license and Lesser GPL library license. 5 5 Whenever there is any discrepancy between the two licenses, … … 53 53 if (!function_exists('odbc_connect')) return null; 54 54 55 if ($this->debug && $argDatabasename && $this->databaseType != 'vfp') { 56 ADOConnection::outp("For odbc Connect(), $argDatabasename is not used. Place dsn in 1st parameter."); 57 } 55 if (!empty($argDatabasename) && stristr($argDSN, 'Database=') === false) { 56 $argDSN = trim($argDSN); 57 $endDSN = substr($argDSN, strlen($argDSN) - 1); 58 if ($endDSN != ';') $argDSN .= ';'; 59 $argDSN .= 'Database='.$argDatabasename; 60 } 61 58 62 if (isset($php_errormsg)) $php_errormsg = ''; 59 63 if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword); … … 162 166 $this->genID = $num; 163 167 return $num; 168 } elseif ($this->affected_rows() == 0) { 169 // some drivers do not return a valid value => try with another method 170 $value = $this->GetOne("select id from $seq"); 171 if ($value == $num + 1) { 172 return $value; 173 } 164 174 } 165 175 } … … 253 263 $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change; 254 264 255 $arr = &$rs->GetArray();265 $arr = $rs->GetArray(); 256 266 $rs->Close(); 257 267 //print_r($arr); … … 265 275 266 276 267 function &MetaTables($ttype=false)277 function MetaTables($ttype=false) 268 278 { 269 279 global $ADODB_FETCH_MODE; … … 282 292 $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change; 283 293 284 $arr = &$rs->GetArray();294 $arr = $rs->GetArray(); 285 295 //print_r($arr); 286 296 … … 371 381 } 372 382 373 function &MetaColumns($table)383 function MetaColumns($table, $normalize=true) 374 384 { 375 385 global $ADODB_FETCH_MODE; … … 423 433 if (empty($qid)) return $false; 424 434 425 $rs = &new ADORecordSet_odbc($qid);435 $rs = new ADORecordSet_odbc($qid); 426 436 $ADODB_FETCH_MODE = $savem; 427 437 … … 615 625 616 626 // returns the field object 617 function &FetchField($fieldOffset = -1)627 function FetchField($fieldOffset = -1) 618 628 { 619 629 … … 662 672 663 673 // speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated 664 function &GetArrayLimit($nrows,$offset=-1)674 function GetArrayLimit($nrows,$offset=-1) 665 675 { 666 676 if ($offset <= 0) { 667 $rs = &$this->GetArray($nrows);677 $rs = $this->GetArray($nrows); 668 678 return $rs; 669 679 } … … 674 684 675 685 if ($this->fetchMode & ADODB_FETCH_ASSOC) { 676 $this->fields = &$this->GetRowAssoc(ADODB_ASSOC_CASE);686 $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); 677 687 } 678 688 … … 701 711 if ($rez) { 702 712 if ($this->fetchMode & ADODB_FETCH_ASSOC) { 703 $this->fields = &$this->GetRowAssoc(ADODB_ASSOC_CASE);713 $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); 704 714 } 705 715 return true; … … 722 732 if ($rez) { 723 733 if ($this->fetchMode & ADODB_FETCH_ASSOC) { 724 $this->fields = &$this->GetRowAssoc(ADODB_ASSOC_CASE);734 $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); 725 735 } 726 736 return true;
Note: See TracChangeset
for help on using the changeset viewer.