[Vtigercrm-commits] [vtiger-commits] r3911 - in /vtigercrm/branches/4.2/adodb: ./ datadict/ drivers/ perf/ session/ session/old/ tests/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Feb 23 14:51:27 EST 2006


Author: jeffk
Date: Thu Feb 23 12:50:55 2006
New Revision: 3911

Log:
refs #7. brings our snapshot to zero-diff with adodb-4.72

Added:
    vtigercrm/branches/4.2/adodb/drivers/adodb-odbc_db2.inc.php
Modified:
    vtigercrm/branches/4.2/adodb/adodb-csvlib.inc.php
    vtigercrm/branches/4.2/adodb/adodb-datadict.inc.php
    vtigercrm/branches/4.2/adodb/adodb-error.inc.php
    vtigercrm/branches/4.2/adodb/adodb-errorhandler.inc.php
    vtigercrm/branches/4.2/adodb/adodb-errorpear.inc.php
    vtigercrm/branches/4.2/adodb/adodb-exceptions.inc.php
    vtigercrm/branches/4.2/adodb/adodb-iterator.inc.php
    vtigercrm/branches/4.2/adodb/adodb-lib.inc.php
    vtigercrm/branches/4.2/adodb/adodb-pager.inc.php
    vtigercrm/branches/4.2/adodb/adodb-pear.inc.php
    vtigercrm/branches/4.2/adodb/adodb-perf.inc.php
    vtigercrm/branches/4.2/adodb/adodb-php4.inc.php
    vtigercrm/branches/4.2/adodb/adodb-time.inc.php
    vtigercrm/branches/4.2/adodb/adodb.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-access.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-db2.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-firebird.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-generic.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-ibase.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-informix.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-mssql.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-mysql.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-oci8.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-postgres.inc.php
    vtigercrm/branches/4.2/adodb/datadict/datadict-sybase.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-access.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-ado.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-ado5.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-ado_access.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-ado_mssql.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-borland_ibase.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-csv.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-db2.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-fbsql.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-firebird.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-ibase.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-informix.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-informix72.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-ldap.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-mssql.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-mssqlpo.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-mysql.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-mysqli.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-mysqlt.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-netezza.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-oci8.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-oci805.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-oci8po.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-odbc.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-odbc_mssql.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-odbc_oracle.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-odbtp.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-odbtp_unicode.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-oracle.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-pdo.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_mssql.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_mysql.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_oci.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_pgsql.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-postgres.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-postgres64.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-postgres7.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-postgres8.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-proxy.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-sapdb.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-sqlanywhere.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-sqlite.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-sqlitepo.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-sybase.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-sybase_ase.inc.php
    vtigercrm/branches/4.2/adodb/drivers/adodb-vfp.inc.php
    vtigercrm/branches/4.2/adodb/perf/perf-db2.inc.php
    vtigercrm/branches/4.2/adodb/perf/perf-informix.inc.php
    vtigercrm/branches/4.2/adodb/perf/perf-mssql.inc.php
    vtigercrm/branches/4.2/adodb/perf/perf-mysql.inc.php
    vtigercrm/branches/4.2/adodb/perf/perf-oci8.inc.php
    vtigercrm/branches/4.2/adodb/perf/perf-postgres.inc.php
    vtigercrm/branches/4.2/adodb/pivottable.inc.php
    vtigercrm/branches/4.2/adodb/rsfilter.inc.php
    vtigercrm/branches/4.2/adodb/server.php
    vtigercrm/branches/4.2/adodb/session/adodb-compress-bzip2.php
    vtigercrm/branches/4.2/adodb/session/adodb-compress-gzip.php
    vtigercrm/branches/4.2/adodb/session/adodb-cryptsession.php
    vtigercrm/branches/4.2/adodb/session/adodb-encrypt-mcrypt.php
    vtigercrm/branches/4.2/adodb/session/adodb-encrypt-md5.php
    vtigercrm/branches/4.2/adodb/session/adodb-encrypt-secret.php
    vtigercrm/branches/4.2/adodb/session/adodb-session-clob.php
    vtigercrm/branches/4.2/adodb/session/adodb-session.php
    vtigercrm/branches/4.2/adodb/session/old/adodb-cryptsession.php
    vtigercrm/branches/4.2/adodb/session/old/adodb-session-clob.php
    vtigercrm/branches/4.2/adodb/session/old/adodb-session.php
    vtigercrm/branches/4.2/adodb/tests/benchmark.php
    vtigercrm/branches/4.2/adodb/tests/pdo.php
    vtigercrm/branches/4.2/adodb/tests/test-datadict.php
    vtigercrm/branches/4.2/adodb/tests/test-php5.php
    vtigercrm/branches/4.2/adodb/tests/test.php
    vtigercrm/branches/4.2/adodb/tests/test3.php
    vtigercrm/branches/4.2/adodb/tests/test5.php
    vtigercrm/branches/4.2/adodb/tests/testcache.php
    vtigercrm/branches/4.2/adodb/tests/testdatabases.inc.php
    vtigercrm/branches/4.2/adodb/tests/testoci8.php
    vtigercrm/branches/4.2/adodb/tests/testoci8cursor.php
    vtigercrm/branches/4.2/adodb/tests/testpaging.php
    vtigercrm/branches/4.2/adodb/tests/testpear.php
    vtigercrm/branches/4.2/adodb/tests/testsessions.php
    vtigercrm/branches/4.2/adodb/toexport.inc.php
    vtigercrm/branches/4.2/adodb/tohtml.inc.php

Modified: vtigercrm/branches/4.2/adodb/adodb-csvlib.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-csvlib.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-csvlib.inc.php Thu Feb 23 12:50:55 2006
@@ -8,7 +8,7 @@
 
 /* 
 
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/adodb-datadict.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-datadict.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-datadict.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/adodb-error.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-error.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-error.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/adodb-errorhandler.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-errorhandler.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-errorhandler.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license.
  * Whenever there is any discrepancy between the two licenses,
  * the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/adodb-errorpear.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-errorpear.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-errorpear.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/adodb-exceptions.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-exceptions.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-exceptions.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * @version V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license.
  * Whenever there is any discrepancy between the two licenses,
  * the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/adodb-iterator.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-iterator.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-iterator.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/adodb-lib.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-lib.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-lib.inc.php Thu Feb 23 12:50:55 2006
@@ -7,7 +7,7 @@
 $ADODB_INCLUDED_LIB = 1;
 
 /* 
- @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim\@natsoft.com.my). All rights reserved.
+ @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim\@natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
@@ -283,7 +283,7 @@
 
 /*
 	Count the number of records this sql statement will return by using
-	query rewriting techniques...
+	query rewriting heuristics...
 	
 	Does not work with UNIONs, except with postgresql and oracle.
 	
@@ -327,7 +327,12 @@
 
 		// fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails 
 		// with mssql, access and postgresql. Also a good speedup optimization - skips sorting!
-		$rewritesql = preg_replace('/(\sORDER\s+BY\s[^)]*)/is','',$rewritesql);
+		// also see http://phplens.com/lens/lensforum/msgs.php?id=12752
+		if (preg_match('/\sORDER\s+BY\s*\(/i',$rewritesql))
+			$rewritesql = preg_replace('/(\sORDER\s+BY\s.*)/is','',$rewritesql);
+		else
+			$rewritesql = preg_replace('/(\sORDER\s+BY\s[^)]*)/is','',$rewritesql);
+		 
 	}
 	
 	if (isset($rewritesql) && $rewritesql != $sql) {
@@ -603,7 +608,7 @@
 			$discard = false;
 			// not a good hack, improvements?
 			if ($whereClause) {
-			var_dump($whereClause);
+			#var_dump($whereClause);
 				if (preg_match('/\s(ORDER\s.*)/is', $whereClause[1], $discard));
 				else if (preg_match('/\s(LIMIT\s.*)/is', $whereClause[1], $discard));
 				else if (preg_match('/\s(FOR UPDATE.*)/is', $whereClause[1], $discard));

Modified: vtigercrm/branches/4.2/adodb/adodb-pager.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-pager.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-pager.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /*
-	V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+	V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
 	  Released under both BSD license and Lesser GPL library license. 
 	  Whenever there is any discrepancy between the two licenses, 
 	  the BSD license will take precedence. 
@@ -60,7 +60,7 @@
 	global $PHP_SELF;
 	
 		$curr_page = $id.'_curr_page';
-		if (empty($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];
+		if (empty($PHP_SELF)) $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']); // htmlspecialchars() to prevent XSS attacks
 		
 		$this->sql = $sql;
 		$this->id = $id;
@@ -70,7 +70,7 @@
 		$next_page = $id.'_next_page';	
 		
 		if (isset($_GET[$next_page])) {
-			$_SESSION[$curr_page] = $_GET[$next_page];
+			$_SESSION[$curr_page] = (integer) $_GET[$next_page];
 		}
 		if (empty($_SESSION[$curr_page])) $_SESSION[$curr_page] = 1; ## at first page
 		

Modified: vtigercrm/branches/4.2/adodb/adodb-pear.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-pear.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-pear.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/adodb-perf.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-perf.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-perf.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/adodb-php4.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-php4.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-php4.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/adodb-time.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb-time.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb-time.inc.php Thu Feb 23 12:50:55 2006
@@ -108,7 +108,7 @@
 	n - month without leading zeros; i.e. "1" to "12" 
 	O - Difference to Greenwich time in hours; e.g. "+0200" 
 	Q - Quarter, as in 1, 2, 3, 4 
-	r - RFC 822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" 
+	r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" 
 	s - seconds; i.e. "00" to "59" 
 	S - English ordinal suffix for the day of the month, 2 characters; 
 	   			i.e. "st", "nd", "rd" or "th" 
@@ -241,6 +241,10 @@
 
 
 CHANGELOG
+- 10 Feb 2006 0.23
+PHP5 compat: when we detect PHP5, the RFC2822 format for gmt 0000hrs is changed from -0000 to +0000. 
+	In PHP4, we will still use -0000 for 100% compat with PHP4.
+
 - 08 Sept 2005 0.22
 In adodb_date2(), $is_gmt not supported properly. Fixed.
 
@@ -361,7 +365,7 @@
 /*
 	Version Number
 */
-define('ADODB_DATE_VERSION',0.22);
+define('ADODB_DATE_VERSION',0.23);
 
 /*
 	This code was originally for windows. But apparently this problem happens 
@@ -473,7 +477,7 @@
 	
 	// Test string formating
 	print "<p>Testing date formating</p>";
-	$fmt = '\d\a\t\e T Y-m-d H:i:s a A d D F g G h H i j l L m M n O \R\F\C822 r s t U w y Y z Z 2003';
+	$fmt = '\d\a\t\e T Y-m-d H:i:s a A d D F g G h H i j l L m M n O \R\F\C2822 r s t U w y Y z Z 2003';
 	$s1 = date($fmt,0);
 	$s2 = adodb_date($fmt,0);
 	if ($s1 != $s2) {
@@ -977,6 +981,8 @@
 	$max = strlen($fmt);
 	$dates = '';
 	
+	$isphp5 = PHP_VERSION >= 5;
+	
 	/*
 		at this point, we have the following integer vars to manipulate:
 		$year, $month, $day, $hour, $min, $secs
@@ -1000,7 +1006,11 @@
 			if ($secs < 10) $dates .= ':0'.$secs; else $dates .= ':'.$secs;
 			
 			$gmt = adodb_get_gmt_diff();
-			$dates .= sprintf(' %s%04d',($gmt<0)?'+':'-',abs($gmt)/36); break;
+			if ($isphp5) 
+				$dates .= sprintf(' %s%04d',($gmt<=0)?'+':'-',abs($gmt)/36); 
+			else
+				$dates .= sprintf(' %s%04d',($gmt<0)?'+':'-',abs($gmt)/36); 
+			break;
 				
 		case 'Y': $dates .= $year; break;
 		case 'y': $dates .= substr($year,strlen($year)-2,2); break;
@@ -1031,7 +1041,12 @@
 			$dates .= ($is_gmt) ? 0 : -adodb_get_gmt_diff(); break;
 		case 'O': 
 			$gmt = ($is_gmt) ? 0 : adodb_get_gmt_diff();
-			$dates .= sprintf('%s%04d',($gmt<0)?'+':'-',abs($gmt)/36); break;
+			
+			if ($isphp5)
+				$dates .= sprintf('%s%04d',($gmt<=0)?'+':'-',abs($gmt)/36); 
+			else
+				$dates .= sprintf('%s%04d',($gmt<0)?'+':'-',abs($gmt)/36); 
+			break;
 			
 		case 'H': 
 			if ($hour < 10) $dates .= '0'.$hour; 

Modified: vtigercrm/branches/4.2/adodb/adodb.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/adodb.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/adodb.inc.php Thu Feb 23 12:50:55 2006
@@ -14,7 +14,7 @@
 /**
 	\mainpage 	
 	
-	 @version V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+	 @version V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
 
 	Released under both BSD license and Lesser GPL library license. You can choose which license
 	you prefer.
@@ -171,7 +171,7 @@
 		/**
 		 * ADODB version as a string.
 		 */
-		$ADODB_vers = 'V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
+		$ADODB_vers = 'V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
 	
 		/**
 		 * Determines whether recordset->RecordCount() is used. 
@@ -1506,11 +1506,11 @@
    * Flush cached recordsets that match a particular $sql statement. 
    * If $sql == false, then we purge all files in the cache.
     */
-   function CacheFlush($sql=false,$inputarr=false)
-   {
-   global $ADODB_CACHE_DIR;
-   
-      if (strlen($ADODB_CACHE_DIR) > 1 && !$sql) {
+	function CacheFlush($sql=false,$inputarr=false)
+	{
+	global $ADODB_CACHE_DIR;
+	
+		if (strlen($ADODB_CACHE_DIR) > 1 && !$sql) {
          /*if (strncmp(PHP_OS,'WIN',3) === 0)
             $dir = str_replace('/', '\\', $ADODB_CACHE_DIR);
          else */
@@ -1787,9 +1787,6 @@
 		return _adodb_getupdatesql($this,$rs,$arrFields,$forceUpdate,$magicq,$force);
 	}
 
-	
-	
-
 	/**
 	 * Generates an Insert Query based on an existing recordset.
 	 * $arrFields is an associative array of fields with the value
@@ -1911,8 +1908,8 @@
 		if (empty($this->_metars)) {
 			$rsclass = $this->rsPrefix.$this->databaseType;
 			$this->_metars =& new $rsclass(false,$this->fetchMode); 
-		}
-		
+			$this->_metars->connection =& $this;
+		}
 		return $this->_metars->MetaType($t,$len,$fieldobj);
 	}
 	
@@ -3731,7 +3728,7 @@
 				$fakedsn = 'fake'.substr($db,$at);
 				$dsna = @parse_url($fakedsn);
 				$dsna['scheme'] = substr($db,0,$at);
-				
+			
 				if (strncmp($db,'pdo',3) == 0) {
 					$sch = explode('_',$dsna['scheme']);
 					if (sizeof($sch)>1) {
@@ -3764,7 +3761,6 @@
 				}
 			} else $opt = array();
 		}
-		
 	/*
 	 *  phptype: Database backend used in PHP (mysql, odbc etc.)
 	 *  dbsyntax: Database used with regards to SQL syntax etc.
@@ -3814,6 +3810,8 @@
 				if (isset($dsna['port'])) $obj->port = $dsna['port'];
 				foreach($opt as $k => $v) {
 					switch(strtolower($k)) {
+					case 'new':
+										$nconnect = true; $persist = true; break;
 					case 'persist':
 					case 'persistent': 	$persist = $v; break;
 					case 'debug':		$obj->debug = (integer) $v; break;
@@ -3837,8 +3835,10 @@
 				}
 				if (empty($persist))
 					$ok = $obj->Connect($dsna['host'], $dsna['user'], $dsna['pass'], $dsna['path']);
+				else if (empty($nconnect))
+					$ok = $obj->PConnect($dsna['host'], $dsna['user'], $dsna['pass'], $dsna['path']);
 				else
-					$ok = $obj->PConnect($dsna['host'], $dsna['user'], $dsna['pass'], $dsna['path']);
+					$ok = $obj->NConnect($dsna['host'], $dsna['user'], $dsna['pass'], $dsna['path']);
 					
 				if (!$ok) return $false;
 			}
@@ -3873,6 +3873,7 @@
 		case 'oracle': $drivername = 'oci8'; break;
 		case 'access': if ($perf) $drivername = ''; break;
 		case 'db2'   : break;
+		case 'odbc_db2': $drivername = 'db2'; break;
 		case 'sapdb' : break;
 		default:
 			$drivername = 'generic';
@@ -3957,4 +3958,4 @@
 
 
 }
-?>
+?>

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-access.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-access.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-access.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-db2.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-db2.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-db2.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-firebird.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-firebird.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-firebird.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-generic.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-generic.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-generic.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-ibase.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-ibase.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-ibase.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-informix.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-informix.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-informix.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-mssql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-mssql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-mssql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-mysql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-mysql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-mysql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-oci8.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-oci8.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-oci8.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-postgres.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-postgres.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-postgres.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/datadict/datadict-sybase.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/datadict/datadict-sybase.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/datadict/datadict-sybase.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-access.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-access.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-access.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-ado.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-ado.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-ado.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-ado5.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-ado5.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-ado5.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-ado_access.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-ado_access.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-ado_access.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
 Released under both BSD license and Lesser GPL library license. 
 Whenever there is any discrepancy between the two licenses, 
 the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-ado_mssql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-ado_mssql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-ado_mssql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-borland_ibase.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-borland_ibase.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-borland_ibase.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-csv.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-csv.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-csv.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-db2.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-db2.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-db2.inc.php Thu Feb 23 12:50:55 2006
@@ -1,158 +1,299 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
-Set tabs to 4 for best viewing.
-  
-  Latest version is available at http://adodb.sourceforge.net
-  
-  DB2 data driver. Requires ODBC.
- 
-From phpdb list:
-
-Hi Andrew,
-
-thanks a lot for your help. Today we discovered what
-our real problem was:
-
-After "playing" a little bit with the php-scripts that try
-to connect to the IBM DB2, we set the optional parameter
-Cursortype when calling odbc_pconnect(....).
-
-And the exciting thing: When we set the cursor type
-to SQL_CUR_USE_ODBC Cursor Type, then
-the whole query speed up from 1 till 10 seconds
-to 0.2 till 0.3 seconds for 100 records. Amazing!!!
-
-Therfore, PHP is just almost fast as calling the DB2
-from Servlets using JDBC (don't take too much care
-about the speed at whole: the database was on a
-completely other location, so the whole connection
-was made over a slow network connection).
-
-I hope this helps when other encounter the same
-problem when trying to connect to DB2 from
-PHP.
-
-Kind regards,
-Christian Szardenings
-
-2 Oct 2001
-Mark Newnham has discovered that the SQL_CUR_USE_ODBC is not supported by 
-IBM's DB2 ODBC driver, so this must be a 3rd party ODBC driver.
-
-From the IBM CLI Reference:
-
-SQL_ATTR_ODBC_CURSORS (DB2 CLI v5) 
-This connection attribute is defined by ODBC, but is not supported by DB2
-CLI. Any attempt to set or get this attribute will result in an SQLSTATE of
-HYC00 (Driver not capable). 
-
-A 32-bit option specifying how the Driver Manager uses the ODBC cursor
-library. 
-
-So I guess this means the message [above] was related to using a 3rd party
-odbc driver.
-
-Setting SQL_CUR_USE_ODBC
-========================
-To set SQL_CUR_USE_ODBC for drivers that require it, do this:
-
-$db = NewADOConnection('db2');
-$db->curMode = SQL_CUR_USE_ODBC;
-$db->Connect($dsn, $userid, $pwd);
-
-
-
-USING CLI INTERFACE
-===================
-
-I have had reports that the $host and $database params have to be reversed in 
-Connect() when using the CLI interface. From Halmai Csongor csongor.halmai#nexum.hu:
-
-> The symptom is that if I change the database engine from postgres or any other to DB2 then the following
-> connection command becomes wrong despite being described this version to be correct in the docs. 
->
-> $connection_object->Connect( $DATABASE_HOST, $DATABASE_AUTH_USER_NAME, $DATABASE_AUTH_PASSWORD, $DATABASE_NAME )
->
-> In case of DB2 I had to swap the first and last arguments in order to connect properly. 
-
-
+  V4.72 21 Feb 2006  (c) 2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+
+This is a version of the ADODB driver for DB2.  It uses the 'ibm_db2' PECL extension for PHP
+  (http://pecl.php.net/package/ibm_db2), which in turn requires DB2 V8.2.2.
+
+  Tested with PHP 5.1.1 and Apache 2.0.55 on Windows XP SP2.
+
+  This file was ported from "adodb-odbc.inc.php" by Larry Menard, "larry.menard at rogers.com".
+  I ripped out what I believed to be a lot of redundant or obsolete code, but there are
+  probably still some remnants of the ODBC support in this file; I'm relying on reviewers
+  of this code to point out any other things that can be removed.
 */
 
 // security - hide paths
 if (!defined('ADODB_DIR')) die();
 
-if (!defined('_ADODB_ODBC_LAYER')) {
-	include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
-}
-if (!defined('ADODB_DB2')){
-define('ADODB_DB2',1);
-
-class ADODB_DB2 extends ADODB_odbc {
+  define("_ADODB_DB2_LAYER", 2 );
+	 
+/*--------------------------------------------------------------------------------------
+--------------------------------------------------------------------------------------*/
+
+
+class ADODB_db2 extends ADOConnection {
 	var $databaseType = "db2";	
-	var $concat_operator = '||';
-	var $sysDate = 'CURRENT_DATE';
-	var $sysTimeStamp = 'CURRENT TIMESTAMP';
-	// The complete string representation of a timestamp has the form 
-	// yyyy-mm-dd-hh.mm.ss.nnnnnn.
-	var $fmtTimeStamp = "'Y-m-d-H.i.s'";
-	var $ansiOuter = true;
-	var $identitySQL = 'values IDENTITY_VAL_LOCAL()';
-	var $_bindInputArray = true;
-	 var $hasInsertID = true;
-	
-	function ADODB_DB2()
-	{
-		if (strncmp(PHP_OS,'WIN',3) === 0) $this->curmode = SQL_CUR_USE_ODBC;
-		$this->ADODB_odbc();
-	}
-	
-	function IfNull( $field, $ifNull ) 
-	{
-		return " COALESCE($field, $ifNull) "; // if DB2 UDB
-	}
+	var $fmtDate = "'Y-m-d'";
+	var $fmtTimeStamp = "'Y-m-d, h:i:sA'";
+	var $replaceQuote = "''"; // string to use to replace quotes
+	var $dataProvider = "db2";
+	var $hasAffectedRows = true;
+
+	var $binmode = DB2_BINARY;
+
+	var $useFetchArray = false; // setting this to true will make array elements in FETCH_ASSOC mode case-sensitive
+								// breaking backward-compat
+	var $_bindInputArray = false;	
+	var $_genSeqSQL = "create table %s (id integer)";
+	var $_autocommit = true;
+	var $_haserrorfunctions = true;
+	var $_lastAffectedRows = 0;
+	var $uCaseTables = true; // for meta* functions, uppercase table names
+	
+	function ADODB_db2() 
+	{ 	
+		$this->_haserrorfunctions = ADODB_PHPVER >= 0x4050;
+	}
+	
+		// returns true or false
+	function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
+	{
+		global $php_errormsg;
+		
+		if (!function_exists('db2_connect')) {
+			ADOConnection::outp("Warning: The old ODBC based DB2 driver has been renamed 'odbc_db2'. This ADOdb driver calls PHP's native db2 extension.");
+			return null;
+		}
+		// This needs to be set before the connect().
+		// Replaces the odbc_binmode() call that was in Execute()
+		ini_set('ibm_db2.binmode', $this->binmode);
+
+		if ($argDatabasename) {
+			$this->_connectionID = db2_connect($argDatabasename,$argUsername,$argPassword);
+		} else {
+			$this->_connectionID = db2_connect($argDSN,$argUsername,$argPassword);
+		}
+		if (isset($php_errormsg)) $php_errormsg = '';
+
+		// For db2_connect(), there is an optional 4th arg.  If present, it must be
+		// an array of valid options.  So far, we don't use them.
+
+		$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
+		if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
+		
+		return $this->_connectionID != false;
+	}
+	
+	// returns true or false
+	function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
+	{
+		global $php_errormsg;
+	
+		if (!function_exists('db2_connect')) return null;
+		
+		// This needs to be set before the connect().
+		// Replaces the odbc_binmode() call that was in Execute()
+		ini_set('ibm_db2.binmode', $this->binmode);
+
+		if (isset($php_errormsg)) $php_errormsg = '';
+		$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
+		
+		if ($argDatabasename) {
+			$this->_connectionID = db2_pconnect($argDatabasename,$argUsername,$argPassword);
+		} else {
+			$this->_connectionID = db2_pconnect($argDSN,$argUsername,$argPassword);
+		}
+		if (isset($php_errormsg)) $php_errormsg = '';
+
+		$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
+		if ($this->_connectionID && $this->autoRollback) @db2_rollback($this->_connectionID);
+		if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
+		
+		return $this->_connectionID != false;
+	}
+
 	
 	function ServerInfo()
 	{
-		//odbc_setoption($this->_connectionID,1,101 /*SQL_ATTR_ACCESS_MODE*/, 1 /*SQL_MODE_READ_ONLY*/);
-		$vers = $this->GetOne('select versionnumber from sysibm.sysversions');
-		//odbc_setoption($this->_connectionID,1,101, 0 /*SQL_MODE_READ_WRITE*/);
-		return array('description'=>'DB2 ODBC driver', 'version'=>$vers);
-	}
-	
-	function _insertid()
-	{
-		return $this->GetOne($this->identitySQL);
-	}
-	
-	function RowLock($tables,$where,$flds='1 as ignore')
-	{
-		if ($this->_autocommit) $this->BeginTrans();
-		return $this->GetOne("select $flds from $tables where $where for update");
-	}
-	
-	function &MetaTables($ttype=false,$showSchema=false, $qtable="%", $qschema="%")
+	
+		if (!empty($this->host) && ADODB_PHPVER >= 0x4300) {
+			$dsn = strtoupper($this->host);
+			$first = true;
+			$found = false;
+			
+			if (!function_exists('db2_data_source')) return false;
+			
+			while(true) {
+				
+				$rez = @db2_data_source($this->_connectionID,
+					$first ? SQL_FETCH_FIRST : SQL_FETCH_NEXT);
+				$first = false;
+				if (!is_array($rez)) break;
+				if (strtoupper($rez['server']) == $dsn) {
+					$found = true;
+					break;
+				}
+			} 
+			if (!$found) return ADOConnection::ServerInfo();
+			if (!isset($rez['version'])) $rez['version'] = '';
+			return $rez;
+		} else {
+			return ADOConnection::ServerInfo();
+		}
+	}
+
+	
+	function CreateSequence($seqname='adodbseq',$start=1)
+	{
+		if (empty($this->_genSeqSQL)) return false;
+		$ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
+		if (!$ok) return false;
+		$start -= 1;
+		return $this->Execute("insert into $seqname values($start)");
+	}
+	
+	var $_dropSeqSQL = 'drop table %s';
+	function DropSequence($seqname)
+	{
+		if (empty($this->_dropSeqSQL)) return false;
+		return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
+	}
+	
+	/*
+		This algorithm is not very efficient, but works even if table locking
+		is not available.
+		
+		Will return false if unable to generate an ID after $MAXLOOPS attempts.
+	*/
+	function GenID($seq='adodbseq',$start=1)
+	{	
+		// if you have to modify the parameter below, your database is overloaded,
+		// or you need to implement generation of id's yourself!
+		$MAXLOOPS = 100;
+		while (--$MAXLOOPS>=0) {
+			$num = $this->GetOne("select id from $seq");
+			if ($num === false) {
+				$this->Execute(sprintf($this->_genSeqSQL ,$seq));	
+				$start -= 1;
+				$num = '0';
+				$ok = $this->Execute("insert into $seq values($start)");
+				if (!$ok) return false;
+			} 
+			$this->Execute("update $seq set id=id+1 where id=$num");
+			
+			if ($this->affected_rows() > 0) {
+				$num += 1;
+				$this->genID = $num;
+				return $num;
+			}
+		}
+		if ($fn = $this->raiseErrorFn) {
+			$fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
+		}
+		return false;
+	}
+
+
+	function ErrorMsg()
+	{
+		if ($this->_haserrorfunctions) {
+			if ($this->_errorMsg !== false) return $this->_errorMsg;
+			if (empty($this->_connectionID)) return @db2_errormsg();
+			return @db2_errormsg($this->_connectionID);
+		} else return ADOConnection::ErrorMsg();
+	}
+	
+	function ErrorNo()
+	{
+		
+		if ($this->_haserrorfunctions) {
+			if ($this->_errorCode !== false) {
+				// bug in 4.0.6, error number can be corrupted string (should be 6 digits)
+				return (strlen($this->_errorCode)<=2) ? 0 : $this->_errorCode;
+			}
+
+			if (empty($this->_connectionID)) $e = @db2_error(); 
+			else $e = @db2_error($this->_connectionID);
+			
+			 // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
+			 // so we check and patch
+			if (strlen($e)<=2) return 0;
+			return $e;
+		} else return ADOConnection::ErrorNo();
+	}
+	
+	
+
+	function BeginTrans()
+	{	
+		if (!$this->hasTransactions) return false;
+		if ($this->transOff) return true; 
+		$this->transCnt += 1;
+		$this->_autocommit = false;
+		return db2_autocommit($this->_connectionID,false);
+	}
+	
+	function CommitTrans($ok=true) 
+	{ 
+		if ($this->transOff) return true; 
+		if (!$ok) return $this->RollbackTrans();
+		if ($this->transCnt) $this->transCnt -= 1;
+		$this->_autocommit = true;
+		$ret = db2_commit($this->_connectionID);
+		db2_autocommit($this->_connectionID,true);
+		return $ret;
+	}
+	
+	function RollbackTrans()
+	{
+		if ($this->transOff) return true; 
+		if ($this->transCnt) $this->transCnt -= 1;
+		$this->_autocommit = true;
+		$ret = db2_rollback($this->_connectionID);
+		db2_autocommit($this->_connectionID,true);
+		return $ret;
+	}
+	
+	function MetaPrimaryKeys($table)
 	{
 	global $ADODB_FETCH_MODE;
 	
+		if ($this->uCaseTables) $table = strtoupper($table);
+		$schema = '';
+		$this->_findschema($table,$schema);
+
 		$savem = $ADODB_FETCH_MODE;
 		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-		$qid = odbc_tables($this->_connectionID, "", $qschema, $qtable, "");
-		
-		$rs = new ADORecordSet_odbc($qid);
+		$qid = @db2_primarykeys($this->_connectionID,'',$schema,$table);
+		
+		if (!$qid) {
+			$ADODB_FETCH_MODE = $savem;
+			return false;
+		}
+		$rs = new ADORecordSet_db2($qid);
+		$ADODB_FETCH_MODE = $savem;
+		
+		if (!$rs) return false;
+		
+		$arr =& $rs->GetArray();
+		$rs->Close();
+		$arr2 = array();
+		for ($i=0; $i < sizeof($arr); $i++) {
+			if ($arr[$i][3]) $arr2[] = $arr[$i][3];
+		}
+		return $arr2;
+	}
+	
+	
+	
+	function &MetaTables($ttype=false)
+	{
+	global $ADODB_FETCH_MODE;
+	
+		$savem = $ADODB_FETCH_MODE;
+		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+		$qid = db2_tables($this->_connectionID);
+		
+		$rs = new ADORecordSet_db2($qid);
 		
 		$ADODB_FETCH_MODE = $savem;
 		if (!$rs) {
 			$false = false;
 			return $false;
 		}
-		$rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
 		
 		$arr =& $rs->GetArray();
-		//print_r($arr);
 		
 		$rs->Close();
 		$arr2 = array();
@@ -161,202 +302,386 @@
 			$isview = strncmp($ttype,'V',1) === 0;
 		}
 		for ($i=0; $i < sizeof($arr); $i++) {
-		
 			if (!$arr[$i][2]) continue;
-			if (strncmp($arr[$i][1],'SYS',3) === 0) continue;
-			
 			$type = $arr[$i][3];
-			
-			if ($showSchema) $arr[$i][2] = $arr[$i][1].'.'.$arr[$i][2];
-			
 			if ($ttype) { 
 				if ($isview) {
 					if (strncmp($type,'V',1) === 0) $arr2[] = $arr[$i][2];
-				} else if (strncmp($type,'T',1) === 0) $arr2[] = $arr[$i][2];
-			} else if (strncmp($type,'S',1) !== 0) $arr2[] = $arr[$i][2];
+				} else if (strncmp($type,'SYS',3) !== 0) $arr2[] = $arr[$i][2];
+			} else if (strncmp($type,'SYS',3) !== 0) $arr2[] = $arr[$i][2];
 		}
 		return $arr2;
 	}
-
-	function &MetaIndexes ($table, $primary = FALSE, $owner=false)
-	{
-        // save old fetch mode
-        global $ADODB_FETCH_MODE;
-        $save = $ADODB_FETCH_MODE;
-        $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-        if ($this->fetchMode !== FALSE) {
-               $savem = $this->SetFetchMode(FALSE);
-        }
+	
+/*
+See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/db2/htm/db2datetime_data_type_changes.asp
+/ SQL data type codes /
+#define	SQL_UNKNOWN_TYPE	0
+#define SQL_CHAR			1
+#define SQL_NUMERIC		 2
+#define SQL_DECIMAL		 3
+#define SQL_INTEGER		 4
+#define SQL_SMALLINT		5
+#define SQL_FLOAT		   6
+#define SQL_REAL			7
+#define SQL_DOUBLE		  8
+#if (DB2VER >= 0x0300)
+#define SQL_DATETIME		9
+#endif
+#define SQL_VARCHAR		12
+
+
+/ One-parameter shortcuts for date/time data types /
+#if (DB2VER >= 0x0300)
+#define SQL_TYPE_DATE	  91
+#define SQL_TYPE_TIME	  92
+#define SQL_TYPE_TIMESTAMP 93
+
+#define SQL_UNICODE                             (-95)
+#define SQL_UNICODE_VARCHAR                     (-96)
+#define SQL_UNICODE_LONGVARCHAR                 (-97)
+*/
+	function DB2Types($t)
+	{
+		switch ((integer)$t) {
+		case 1:	
+		case 12:
+		case 0:
+		case -95:
+		case -96:
+			return 'C';
+		case -97:
+		case -1: //text
+			return 'X';
+		case -4: //image
+			return 'B';
+				
+		case 9:	
+		case 91:
+			return 'D';
+		
+		case 10:
+		case 11:
+		case 92:
+		case 93:
+			return 'T';
+			
+		case 4:
+		case 5:
+		case -6:
+			return 'I';
+			
+		case -11: // uniqidentifier
+			return 'R';
+		case -7: //bit
+			return 'L';
+		
+		default:
+			return 'N';
+		}
+	}
+	
+	function &MetaColumns($table)
+	{
+	global $ADODB_FETCH_MODE;
+	
 		$false = false;
-		// get index details
-		$table = strtoupper($table);
-		$SQL="SELECT NAME, UNIQUERULE, COLNAMES FROM SYSIBM.SYSINDEXES WHERE TBNAME='$table'";
-        if ($primary) 
-			$SQL.= " AND UNIQUERULE='P'";
-		$rs = $this->Execute($SQL);
-        if (!is_object($rs)) {
-			if (isset($savem)) 
-				$this->SetFetchMode($savem);
-			$ADODB_FETCH_MODE = $save;
-            return $false;
-        }
-		$indexes = array ();
-        // parse index data into array
-        while ($row = $rs->FetchRow()) {
-			$indexes[$row[0]] = array(
-			   'unique' => ($row[1] == 'U' || $row[1] == 'P'),
-			   'columns' => array()
-			);
-			$cols = ltrim($row[2],'+');
-			$indexes[$row[0]]['columns'] = explode('+', $cols);
-        }
-		if (isset($savem)) { 
-            $this->SetFetchMode($savem);
-			$ADODB_FETCH_MODE = $save;
-		}
-        return $indexes;
-	}
-	
-	// Format date column in sql string given an input format that understands Y M D
-	function SQLDate($fmt, $col=false)
-	{	
-	// use right() and replace() ?
-		if (!$col) $col = $this->sysDate;
-		$s = '';
-		
-		$len = strlen($fmt);
-		for ($i=0; $i < $len; $i++) {
-			if ($s) $s .= '||';
-			$ch = $fmt[$i];
-			switch($ch) {
-			case 'Y':
-			case 'y':
-				$s .= "char(year($col))";
+		if ($this->uCaseTables) $table = strtoupper($table);
+		$schema = '';
+		$this->_findschema($table,$schema);
+		
+		$savem = $ADODB_FETCH_MODE;
+		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	
+        	$colname = "%";
+	        $qid = db2_columns($this->_connectionID, "", $schema, $table, $colname);
+		if (empty($qid)) return $false;
+		
+		$rs =& new ADORecordSet_db2($qid);
+		$ADODB_FETCH_MODE = $savem;
+		
+		if (!$rs) return $false;
+		$rs->_fetch();
+		
+		$retarr = array();
+		
+		/*
+		$rs->fields indices
+		0 TABLE_QUALIFIER
+		1 TABLE_SCHEM
+		2 TABLE_NAME
+		3 COLUMN_NAME
+		4 DATA_TYPE
+		5 TYPE_NAME
+		6 PRECISION
+		7 LENGTH
+		8 SCALE
+		9 RADIX
+		10 NULLABLE
+		11 REMARKS
+		*/
+		while (!$rs->EOF) {
+			if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
+				$fld = new ADOFieldObject();
+				$fld->name = $rs->fields[3];
+				$fld->type = $this->DB2Types($rs->fields[4]);
+				
+				// ref: http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraccgen/html/msdn_odk.asp
+				// access uses precision to store length for char/varchar
+				if ($fld->type == 'C' or $fld->type == 'X') {
+					if ($rs->fields[4] <= -95) // UNICODE
+						$fld->max_length = $rs->fields[7]/2;
+					else
+						$fld->max_length = $rs->fields[7];
+				} else 
+					$fld->max_length = $rs->fields[7];
+				$fld->not_null = !empty($rs->fields[10]);
+				$fld->scale = $rs->fields[8];
+				$retarr[strtoupper($fld->name)] = $fld;	
+			} else if (sizeof($retarr)>0)
 				break;
-			case 'M':
-				$s .= "substr(monthname($col),1,3)";
-				break;
-			case 'm':
-				$s .= "right(digits(month($col)),2)";
-				break;
-			case 'D':
-			case 'd':
-				$s .= "right(digits(day($col)),2)";
-				break;
-			case 'H':
-			case 'h':
-				if ($col != $this->sysDate) $s .= "right(digits(hour($col)),2)";	
-				else $s .= "''";
-				break;
-			case 'i':
-			case 'I':
-				if ($col != $this->sysDate)
-					$s .= "right(digits(minute($col)),2)";
-					else $s .= "''";
-				break;
-			case 'S':
-			case 's':
-				if ($col != $this->sysDate)
-					$s .= "right(digits(second($col)),2)";
-				else $s .= "''";
-				break;
-			default:
-				if ($ch == '\\') {
-					$i++;
-					$ch = substr($fmt,$i,1);
+			$rs->MoveNext();
+		}
+		$rs->Close(); //-- crashes 4.03pl1 -- why?
+		
+		if (empty($retarr)) $retarr = false;
+		return $retarr;
+	}
+	
+	function Prepare($sql)
+	{
+		if (! $this->_bindInputArray) return $sql; // no binding
+		$stmt = db2_prepare($this->_connectionID,$sql);
+		if (!$stmt) {
+			// we don't know whether db2 driver is parsing prepared stmts, so just return sql
+			return $sql;
+		}
+		return array($sql,$stmt,false);
+	}
+
+	/* returns queryID or false */
+	function _query($sql,$inputarr=false) 
+	{
+	GLOBAL $php_errormsg;
+		if (isset($php_errormsg)) $php_errormsg = '';
+		$this->_error = '';
+		
+		if ($inputarr) {
+			if (is_array($sql)) {
+				$stmtid = $sql[1];
+			} else {
+				$stmtid = db2_prepare($this->_connectionID,$sql);
+	
+				if ($stmtid == false) {
+					$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
+					return false;
 				}
-				$s .= $this->qstr($ch);
-			}
-		}
-		return $s;
-	} 
- 
-	
-	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputArr=false)
-	{
-		$nrows = (integer) $nrows;
+			}
+			
+			if (! db2_execute($stmtid,$inputarr)) {
+				if ($this->_haserrorfunctions) {
+					$this->_errorMsg = db2_errormsg();
+					$this->_errorCode = db2_error();
+				}
+				return false;
+			}
+		
+		} else if (is_array($sql)) {
+			$stmtid = $sql[1];
+			if (!db2_execute($stmtid)) {
+				if ($this->_haserrorfunctions) {
+					$this->_errorMsg = db2_errormsg();
+					$this->_errorCode = db2_error();
+				}
+				return false;
+			}
+		} else
+			$stmtid = db2_exec($this->_connectionID,$sql);
+		
+		$this->_lastAffectedRows = 0;
+		if ($stmtid) {
+			if (@db2_num_fields($stmtid) == 0) {
+				$this->_lastAffectedRows = db2_num_rows($stmtid);
+				$stmtid = true;
+			} else {
+				$this->_lastAffectedRows = 0;
+			}
+			
+			if ($this->_haserrorfunctions) {
+				$this->_errorMsg = '';
+				$this->_errorCode = 0;
+			} else
+				$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
+		} else {
+			if ($this->_haserrorfunctions) {
+				$this->_errorMsg = db2_stmt_errormsg();
+				$this->_errorCode = db2_stmt_error();
+			} else
+				$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
+		}
+		return $stmtid;
+	}
+
+	/*
+		Insert a null into the blob field of the table first.
+		Then use UpdateBlob to store the blob.
+		
+		Usage:
+		 
+		$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
+		$conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
+	*/
+	function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
+	{
+		return $this->Execute("UPDATE $table SET $column=? WHERE $where",array($val)) != false;
+	}
+	
+	// returns true or false
+	function _close()
+	{
+		$ret = @db2_close($this->_connectionID);
+		$this->_connectionID = false;
+		return $ret;
+	}
+
+	function _affectedrows()
+	{
+		return $this->_lastAffectedRows;
+	}
+	
+}
+	
+/*--------------------------------------------------------------------------------------
+	 Class Name: Recordset
+--------------------------------------------------------------------------------------*/
+
+class ADORecordSet_db2 extends ADORecordSet {	
+	
+	var $bind = false;
+	var $databaseType = "db2";		
+	var $dataProvider = "db2";
+	var $useFetchArray;
+	
+	function ADORecordSet_db2($id,$mode=false)
+	{
+		if ($mode === false) {  
+			global $ADODB_FETCH_MODE;
+			$mode = $ADODB_FETCH_MODE;
+		}
+		$this->fetchMode = $mode;
+		
+		$this->_queryID = $id;
+	}
+
+
+	// returns the field object
+	function &FetchField($fieldOffset = -1) 
+	{
+		
+		$off=$fieldOffset+1; // offsets begin at 1
+		
+		$o= new ADOFieldObject();
+		$o->name = @db2_field_name($this->_queryID,$off);
+		$o->type = @db2_field_type($this->_queryID,$off);
+		$o->max_length = db2_field_width($this->_queryID,$off);
+		if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
+		else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
+		return $o;
+	}
+	
+	/* Use associative array to get fields array */
+	function Fields($colname)
+	{
+		if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
+		if (!$this->bind) {
+			$this->bind = array();
+			for ($i=0; $i < $this->_numOfFields; $i++) {
+				$o = $this->FetchField($i);
+				$this->bind[strtoupper($o->name)] = $i;
+			}
+		}
+
+		 return $this->fields[$this->bind[strtoupper($colname)]];
+	}
+	
+		
+	function _initrs()
+	{
+	global $ADODB_COUNTRECS;
+		$this->_numOfRows = ($ADODB_COUNTRECS) ? @db2_num_rows($this->_queryID) : -1;
+		$this->_numOfFields = @db2_num_fields($this->_queryID);
+		// some silly drivers such as db2 as/400 and intersystems cache return _numOfRows = 0
+		if ($this->_numOfRows == 0) $this->_numOfRows = -1;
+	}	
+	
+	function _seek($row)
+	{
+		return false;
+	}
+	
+	// speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated
+	function &GetArrayLimit($nrows,$offset=-1) 
+	{
 		if ($offset <= 0) {
-		// could also use " OPTIMIZE FOR $nrows ROWS "
-			if ($nrows >= 0) $sql .=  " FETCH FIRST $nrows ROWS ONLY ";
-			$rs =& $this->Execute($sql,$inputArr);
-		} else {
-			if ($offset > 0 && $nrows < 0);
-			else {
-				$nrows += $offset;
-				$sql .=  " FETCH FIRST $nrows ROWS ONLY ";
-			}
-			$rs =& ADOConnection::SelectLimit($sql,-1,$offset,$inputArr);
-		}
-		
-		return $rs;
-	}
-	
-};
- 
-
-class  ADORecordSet_db2 extends ADORecordSet_odbc {	
-	
-	var $databaseType = "db2";		
-	
-	function ADORecordSet_db2($id,$mode=false)
-	{
-		$this->ADORecordSet_odbc($id,$mode);
-	}
-
-	function MetaType($t,$len=-1,$fieldobj=false)
-	{
-		if (is_object($t)) {
-			$fieldobj = $t;
-			$t = $fieldobj->type;
-			$len = $fieldobj->max_length;
-		}
-		
-		switch (strtoupper($t)) {
-		case 'VARCHAR':
-		case 'CHAR':
-		case 'CHARACTER':
-		case 'C':
-			if ($len <= $this->blobSize) return 'C';
-		
-		case 'LONGCHAR':
-		case 'TEXT':
-		case 'CLOB':
-		case 'DBCLOB': // double-byte
-		case 'X':
-			return 'X';
-		
-		case 'BLOB':
-		case 'GRAPHIC':
-		case 'VARGRAPHIC':
-			return 'B';
-			
-		case 'DATE':
-		case 'D':
-			return 'D';
-		
-		case 'TIME':
-		case 'TIMESTAMP':
-		case 'T':
-			return 'T';
-		
-		//case 'BOOLEAN': 
-		//case 'BIT':
-		//	return 'L';
-			
-		//case 'COUNTER':
-		//	return 'R';
-			
-		case 'INT':
-		case 'INTEGER':
-		case 'BIGINT':
-		case 'SMALLINT':
-		case 'I':
-			return 'I';
-			
-		default: return 'N';
-		}
-	}
+			$rs =& $this->GetArray($nrows);
+			return $rs;
+		}
+		$savem = $this->fetchMode;
+		$this->fetchMode = ADODB_FETCH_NUM;
+		$this->Move($offset);
+		$this->fetchMode = $savem;
+		
+		if ($this->fetchMode & ADODB_FETCH_ASSOC) {
+			$this->fields =& $this->GetRowAssoc(ADODB_ASSOC_CASE);
+		}
+		
+		$results = array();
+		$cnt = 0;
+		while (!$this->EOF && $nrows != $cnt) {
+			$results[$cnt++] = $this->fields;
+			$this->MoveNext();
+		}
+		
+		return $results;
+	}
+	
+	
+	function MoveNext() 
+	{
+		if ($this->_numOfRows != 0 && !$this->EOF) {		
+			$this->_currentRow++;
+			
+			$this->fields = @db2_fetch_array($this->_queryID);
+			if ($this->fields) {
+				if ($this->fetchMode & ADODB_FETCH_ASSOC) {
+					$this->fields =& $this->GetRowAssoc(ADODB_ASSOC_CASE);
+				}
+				return true;
+			}
+		}
+		$this->fields = false;
+		$this->EOF = true;
+		return false;
+	}	
+	
+	function _fetch()
+	{
+
+		$this->fields = db2_fetch_array($this->_queryID);
+		if ($this->fields) {
+			if ($this->fetchMode & ADODB_FETCH_ASSOC) {
+				$this->fields =& $this->GetRowAssoc(ADODB_ASSOC_CASE);
+			}
+			return true;
+		}
+		$this->fields = false;
+		return false;
+	}
+	
+	function _close() 
+	{
+		return @db2_free_result($this->_queryID);		
+	}
+
 }
-
-} //define
 ?>

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-fbsql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-fbsql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-fbsql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
- @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-firebird.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-firebird.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-firebird.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-ibase.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-ibase.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-ibase.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.  
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.  
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-informix.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-informix.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-informix.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+* @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
 * Released under both BSD license and Lesser GPL library license.
 * Whenever there is any discrepancy between the two licenses,
 * the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-informix72.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-informix72.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-informix72.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim. All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-ldap.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-ldap.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-ldap.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
    Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-mssql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-mssql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-mssql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -161,6 +161,8 @@
 	
 	function CreateSequence($seq='adodbseq',$start=1)
 	{
+		
+		$this->Execute('BEGIN TRANSACTION adodbseq');
 		$start -= 1;
 		$this->Execute("create table $seq (id float(53))");
 		$ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-mssqlpo.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-mssqlpo.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-mssqlpo.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+* @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
 * Released under both BSD license and Lesser GPL library license.
 * Whenever there is any discrepancy between the two licenses,
 * the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-mysql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-mysql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-mysql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-mysqli.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-mysqli.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-mysqli.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-mysqlt.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-mysqlt.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-mysqlt.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-netezza.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-netezza.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-netezza.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
  
   First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com
  Based on the previous postgres drivers.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-oci8.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-oci8.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-oci8.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 /*
 
-  version V4.71 24 Jan 2006 (c) 2000-2006 John Lim. All rights reserved.
+  version V4.72 21 Feb 2006 (c) 2000-2006 John Lim. All rights reserved.
 
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
@@ -298,7 +298,7 @@
 		if ($mask) {
 			$save = $this->metaTablesSQL;
 			$mask = $this->qstr(strtoupper($mask));
-			$this->metaTablesSQL .= " AND table_name like $mask";
+			$this->metaTablesSQL .= " AND upper(table_name) like $mask";
 		}
 		$ret =& ADOConnection::MetaTables($ttype,$showSchema);
 		
@@ -1481,4 +1481,4 @@
 		return adodb_movenext($this);
 	}
 }
-?>
+?>

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-oci805.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-oci805.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-oci805.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-oci8po.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-oci8po.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-oci8po.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim. All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-odbc.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-odbc.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-odbc.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-odbc_mssql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-odbc_mssql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-odbc_mssql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-odbc_oracle.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-odbc_oracle.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-odbc_oracle.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-odbtp.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-odbtp.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-odbtp.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence. See License.txt.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-odbtp_unicode.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-odbtp_unicode.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-odbtp_unicode.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-	V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+	V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence. See License.txt.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-oracle.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-oracle.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-oracle.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-pdo.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-pdo.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-pdo.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_mssql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_mssql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_mssql.inc.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_mysql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_mysql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_mysql.inc.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_oci.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_oci.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_oci.inc.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_pgsql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_pgsql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-pdo_pgsql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-postgres.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-postgres.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-postgres.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-postgres64.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-postgres64.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-postgres64.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-postgres7.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-postgres7.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-postgres7.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
+ V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-postgres8.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-postgres8.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-postgres8.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-proxy.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-proxy.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-proxy.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-sapdb.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-sapdb.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-sapdb.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-sqlanywhere.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-sqlanywhere.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-sqlanywhere.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-version V4.71 24 Jan 2006 (c) 2000-2006  John Lim (jlim at natsoft.com.my).  All rights
+version V4.72 21 Feb 2006 (c) 2000-2006  John Lim (jlim at natsoft.com.my).  All rights
 reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-sqlite.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-sqlite.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-sqlite.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-sqlitepo.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-sqlitepo.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-sqlitepo.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-sybase.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-sybase.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-sybase.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim. All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-sybase_ase.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-sybase_ase.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-sybase_ase.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/drivers/adodb-vfp.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/drivers/adodb-vfp.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/drivers/adodb-vfp.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/perf/perf-db2.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/perf/perf-db2.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/perf/perf-db2.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/perf/perf-informix.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/perf/perf-informix.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/perf/perf-informix.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/perf/perf-mssql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/perf/perf-mssql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/perf/perf-mssql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/perf/perf-mysql.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/perf/perf-mysql.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/perf/perf-mysql.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/perf/perf-oci8.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/perf/perf-oci8.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/perf/perf-oci8.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/perf/perf-postgres.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/perf/perf-postgres.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/perf/perf-postgres.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: vtigercrm/branches/4.2/adodb/pivottable.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/pivottable.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/pivottable.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
@@ -23,7 +23,7 @@
  * @where			Where clause. Optional.
  * @aggfield		This is the field to sum. Optional. 
  *						Since 2.3.1, if you can use your own aggregate function 
- *						instead of SUM, eg. $sumfield = 'AVG(fieldname)';
+ *						instead of SUM, eg. $aggfield = 'fieldname'; $aggfn = 'AVG';
  * @sumlabel		Prefix to display in sum columns. Optional.
  * @aggfn			Aggregate function to use (could be AVG, SUM, COUNT)
  * @showcount		Show count of records
@@ -31,7 +31,7 @@
  * @returns			Sql generated
  */
  
- function PivotTableSQL($db,$tables,$rowfields,$colfield, $where=false,
+ function PivotTableSQL(&$db,$tables,$rowfields,$colfield, $where=false,
  	$aggfield = false,$sumlabel='Sum ',$aggfn ='SUM', $showcount = true)
  {
 	if ($aggfield) $hidecnt = true;

Modified: vtigercrm/branches/4.2/adodb/rsfilter.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/rsfilter.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/rsfilter.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/server.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/server.php (original)
+++ vtigercrm/branches/4.2/adodb/server.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /** 
- * @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/session/adodb-compress-bzip2.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/adodb-compress-bzip2.php (original)
+++ vtigercrm/branches/4.2/adodb/session/adodb-compress-bzip2.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: vtigercrm/branches/4.2/adodb/session/adodb-compress-gzip.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/adodb-compress-gzip.php (original)
+++ vtigercrm/branches/4.2/adodb/session/adodb-compress-gzip.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: vtigercrm/branches/4.2/adodb/session/adodb-cryptsession.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/adodb-cryptsession.php (original)
+++ vtigercrm/branches/4.2/adodb/session/adodb-cryptsession.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: vtigercrm/branches/4.2/adodb/session/adodb-encrypt-mcrypt.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/adodb-encrypt-mcrypt.php (original)
+++ vtigercrm/branches/4.2/adodb/session/adodb-encrypt-mcrypt.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: vtigercrm/branches/4.2/adodb/session/adodb-encrypt-md5.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/adodb-encrypt-md5.php (original)
+++ vtigercrm/branches/4.2/adodb/session/adodb-encrypt-md5.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: vtigercrm/branches/4.2/adodb/session/adodb-encrypt-secret.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/adodb-encrypt-secret.php (original)
+++ vtigercrm/branches/4.2/adodb/session/adodb-encrypt-secret.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: vtigercrm/branches/4.2/adodb/session/adodb-session-clob.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/adodb-session-clob.php (original)
+++ vtigercrm/branches/4.2/adodb/session/adodb-session-clob.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: vtigercrm/branches/4.2/adodb/session/adodb-session.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/adodb-session.php (original)
+++ vtigercrm/branches/4.2/adodb/session/adodb-session.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 
 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: vtigercrm/branches/4.2/adodb/session/old/adodb-cryptsession.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/old/adodb-cryptsession.php (original)
+++ vtigercrm/branches/4.2/adodb/session/old/adodb-cryptsession.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/session/old/adodb-session-clob.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/old/adodb-session-clob.php (original)
+++ vtigercrm/branches/4.2/adodb/session/old/adodb-session-clob.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/session/old/adodb-session.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/session/old/adodb-session.php (original)
+++ vtigercrm/branches/4.2/adodb/session/old/adodb-session.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/tests/benchmark.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/benchmark.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/benchmark.php Thu Feb 23 12:50:55 2006
@@ -8,7 +8,7 @@
 <body>
 <?php 
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/tests/pdo.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/pdo.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/pdo.php Thu Feb 23 12:50:55 2006
@@ -1,82 +1,94 @@
-<?php
-error_reporting(E_ALL);
-include('../adodb.inc.php');
-
-try {
-	echo "New Connection\n";
-	$DB = NewADOConnection('pdo');
-	echo "Connect\n";
-	
-	$u = ''; $p = '';
-	/*
-	$connstr = 'odbc:nwind';
-	
-	$connstr = 'oci:';
-	$u = 'scott';
-	$p = 'natsoft';
-	
-	
-	$connstr ="sqlite:d:\inetpub\adodb\sqlite.db";
-	*/
-	
-	$connstr = "mysql:dbname=northwind";
-	$u = 'root';
-	
-	$connstr = "pgsql:dbname=test";
-	$u = 'tester';
-	$p = 'test';
-	
-	$DB->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-	
-	
-	echo "$connstr: Execute\n";
-	
-	//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	$rs = $DB->Execute("select * from ADOXYZ where id<3");
-	echo "*** e=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
-	
-	
-	//print_r(get_class_methods($DB->_stmt));
-	
-	if (!$rs) die("NO RS");
-	
-	echo "Meta\n";
-	for ($i=0; $i < $rs->NumCols(); $i++) {
-		var_dump($rs->FetchField($i));
-		echo "<br>";
-	}
-	
-	echo "FETCH\n";
-	$cnt = 0;
-	while (!$rs->EOF) {
-		adodb_pr($rs->fields); 
-		$rs->MoveNext();
-		if ($cnt++ > 1000) break;
-	}
-	
-	echo "<br>--------------------------------------------------------<br>\n\n\n";
-	
-	$stmt = $DB->PrepareStmt("select * from ADOXYZ");
-	
-	$rs = $stmt->Execute();
-	$cols = $stmt->NumCols(); // execute required
-	
-	echo "COLS = $cols";
-	for($i=1;$i<=$cols;$i++) {
-		$v = $stmt->_stmt->getColumnMeta($i);
-		var_dump($v);
-	}
-	
-	echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
-	while ($arr = $rs->FetchRow()) {
-		adodb_pr($arr);
-	}
-	die("DONE\n");
-
-} catch (exception $e) {
-	echo "<pre>";
-	echo $e;
-	echo "</pre>";
-}
-
+<?php
+error_reporting(E_ALL);
+include('../adodb.inc.php');
+
+echo "<pre>";
+try {
+	echo "New Connection\n";
+	
+	
+	$dsn = 'pdo_mysql://root:@localhost/northwind?persist';
+	
+	if (!empty($dsn)) {
+		$DB =& NewADOConnection($dsn) || die("CONNECT FAILED");
+		$connstr = $dsn;
+	} else {
+	
+		$DB = NewADOConnection('pdo');
+		
+		echo "Connect\n";
+		
+		$u = ''; $p = '';
+		/*
+		$connstr = 'odbc:nwind';
+		
+		$connstr = 'oci:';
+		$u = 'scott';
+		$p = 'natsoft';
+		
+		
+		$connstr ="sqlite:d:\inetpub\adodb\sqlite.db";
+		*/
+		
+		$connstr = "mysql:dbname=northwind";
+		$u = 'root';
+		
+		$connstr = "pgsql:dbname=test";
+		$u = 'tester';
+		$p = 'test';
+		
+		$DB->Connect($connstr,$u,$p) || die("CONNECT FAILED");
+	
+	}
+	
+	echo "connection string=$connstr\n Execute\n";
+	
+	//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	$rs = $DB->Execute("select * from ADOXYZ where id<3");
+	if  ($DB->ErrorNo()) echo "*** errno=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
+	
+	
+	//print_r(get_class_methods($DB->_stmt));
+	
+	if (!$rs) die("NO RS");
+	
+	echo "Meta\n";
+	for ($i=0; $i < $rs->NumCols(); $i++) {
+		var_dump($rs->FetchField($i));
+		echo "<br>";
+	}
+	
+	echo "FETCH\n";
+	$cnt = 0;
+	while (!$rs->EOF) {
+		adodb_pr($rs->fields); 
+		$rs->MoveNext();
+		if ($cnt++ > 1000) break;
+	}
+	
+	echo "<br>--------------------------------------------------------<br>\n\n\n";
+	
+	$stmt = $DB->PrepareStmt("select * from ADOXYZ");
+	
+	$rs = $stmt->Execute();
+	$cols = $stmt->NumCols(); // execute required
+	
+	echo "COLS = $cols";
+	for($i=1;$i<=$cols;$i++) {
+		$v = $stmt->_stmt->getColumnMeta($i);
+		var_dump($v);
+	}
+	
+	echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
+	while ($arr = $rs->FetchRow()) {
+		adodb_pr($arr);
+	}
+	die("DONE\n");
+
+} catch (exception $e) {
+	echo "<pre>";
+	echo $e;
+	echo "</pre>";
+}
+
 ?>

Modified: vtigercrm/branches/4.2/adodb/tests/test-datadict.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/test-datadict.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/test-datadict.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 /*
 
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -13,7 +13,7 @@
 error_reporting(E_ALL);
 include_once('../adodb.inc.php');
 
-foreach(array('sapdb','sybase','mysqlt','access','oci8','postgres','odbc_mssql','odbc','db2','firebird','informix') as $dbType) {
+foreach(array('sapdb','sybase','mysqlt','access','oci8po','postgres','odbc_mssql','odbc','db2','firebird','informix') as $dbType) {
 	echo "<h3>$dbType</h3><p>";
 	$db = NewADOConnection($dbType);
 	$dict = NewDataDictionary($db);

Modified: vtigercrm/branches/4.2/adodb/tests/test-php5.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/test-php5.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/test-php5.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/tests/test.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/test.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/test.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/tests/test3.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/test3.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/test3.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/tests/test5.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/test5.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/test5.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/tests/testcache.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/testcache.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/testcache.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 <body>
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/tests/testdatabases.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/testdatabases.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/testdatabases.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
   
 /*
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: vtigercrm/branches/4.2/adodb/tests/testoci8.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/testoci8.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/testoci8.php Thu Feb 23 12:50:55 2006
@@ -2,7 +2,7 @@
 <body>
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/tests/testoci8cursor.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/testoci8cursor.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/testoci8cursor.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/tests/testpaging.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/testpaging.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/testpaging.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/tests/testpear.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/testpear.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/testpear.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/tests/testsessions.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tests/testsessions.php (original)
+++ vtigercrm/branches/4.2/adodb/tests/testsessions.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/toexport.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/toexport.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/toexport.inc.php Thu Feb 23 12:50:55 2006
@@ -1,7 +1,7 @@
 <?php
 
 /** 
- * @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.72 21 Feb 2006 (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 

Modified: vtigercrm/branches/4.2/adodb/tohtml.inc.php
==============================================================================
--- vtigercrm/branches/4.2/adodb/tohtml.inc.php (original)
+++ vtigercrm/branches/4.2/adodb/tohtml.inc.php Thu Feb 23 12:50:55 2006
@@ -1,6 +1,6 @@
 <?php 
 /*
-  V4.71 24 Jan 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.72 21 Feb 2006  (c) 2000-2006 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.





More information about the vtigercrm-commits mailing list