Ignore:
Timestamp:
06/29/07 15:17:46 (17 years ago)
Author:
niltonneto
Message:

Versão nova do ADODB (4.5 para 4.95)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/adodb/drivers/adodb-sybase.inc.php

    r2 r34  
    11<?php 
    22/*  
    3 V4.51 29 July 2004  (c) 2000-2004 John Lim. All rights reserved. 
     3V4.94 23 Jan 2007  (c) 2000-2007 John Lim. All rights reserved. 
    44  Released under both BSD license and Lesser GPL library license.  
    55  Whenever there is any discrepancy between the two licenses,  
     
    2121class ADODB_sybase extends ADOConnection { 
    2222        var $databaseType = "sybase";    
    23         //var $dataProvider = 'sybase'; 
     23        var $dataProvider = 'sybase'; 
    2424        var $replaceQuote = "''"; // string to use to replace quotes 
    2525        var $fmtDate = "'Y-m-d'"; 
     
    8787         
    8888        // http://www.isug.com/Sybase_FAQ/ASE/section6.1.html#6.1.4 
    89         function RowLock($tables,$where)  
     89        function RowLock($tables,$where,$flds='top 1 null as ignore')  
    9090        { 
    9191                if (!$this->_hastrans) $this->BeginTrans(); 
    9292                $tables = str_replace(',',' HOLDLOCK,',$tables); 
    93                 return $this->GetOne("select top 1 null as ignore from $tables HOLDLOCK where $where"); 
     93                return $this->GetOne("select $flds from $tables HOLDLOCK where $where"); 
    9494                 
    9595        }        
    9696                 
    97         function SelectDB($dbName) { 
    98                 $this->databaseName = $dbName; 
     97        function SelectDB($dbName)  
     98        { 
     99                $this->database = $dbName; 
     100                $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions 
    99101                if ($this->_connectionID) { 
    100102                        return @sybase_select_db($dbName);               
     
    106108                Note: This function is NOT available for Microsoft SQL Server.  */       
    107109 
    108         function ErrorMsg()  
     110         
     111        function ErrorMsg() 
    109112        { 
    110113                if ($this->_logsql) return $this->_errorMsg; 
    111                 $this->_errorMsg = sybase_get_last_message(); 
     114                if (function_exists('sybase_get_last_message')) 
     115                        $this->_errorMsg = sybase_get_last_message(); 
     116                else 
     117                        $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : 'SYBASE error messages not supported on this platform'; 
    112118                return $this->_errorMsg; 
    113119        } 
     
    152158                        return $rs; 
    153159                } 
    154                 $cnt = ($nrows > 0) ? $nrows : 0; 
     160                 
     161                $nrows = (integer) $nrows; 
     162                $offset = (integer) $offset; 
     163                 
     164                $cnt = ($nrows >= 0) ? $nrows : 999999999; 
    155165                if ($offset > 0 && $cnt) $cnt += $offset; 
    156166                 
    157167                $this->Execute("set rowcount $cnt");  
    158168                $rs =& ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,0); 
    159                 $this->Execute("set rowcount 0");  
     169                $this->Execute("set rowcount 0"); 
    160170                 
    161171                return $rs; 
     
    284294                if (!$mode) $this->fetchMode = ADODB_FETCH_ASSOC; 
    285295                else $this->fetchMode = $mode; 
    286                 return $this->ADORecordSet($id,$mode); 
     296                $this->ADORecordSet($id,$mode); 
    287297        } 
    288298         
Note: See TracChangeset for help on using the changeset viewer.