Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

   1  <?php
   2  /*
   3  @version   v5.21.0  2021-02-27
   4  @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
   5  @copyright (c) 2014      Damien Regad, Mark Newnham and the ADOdb community
   6    Released under both BSD license and Lesser GPL library license.
   7    Whenever there is any discrepancy between the two licenses,
   8    the BSD license will take precedence. See License.txt.
   9    Set tabs to 4 for best viewing.
  10  
  11    Latest version is available at https://adodb.org/
  12  
  13    Microsoft Access data driver. Requires ODBC. Works only on Microsoft Windows.
  14  */
  15  if (!defined('_ADODB_ODBC_LAYER')) {
  16  	 if (!defined('ADODB_DIR')) die();
  17  
  18  	 include_once(ADODB_DIR."/drivers/adodb-odbc.inc.php");
  19  }
  20  
  21  if (!defined('_ADODB_ACCESS')) {
  22  	 define('_ADODB_ACCESS',1);
  23  
  24  class  ADODB_access extends ADODB_odbc {
  25  	 var $databaseType = 'access';
  26  	 var $hasTop = 'top';	 	 // support mssql SELECT TOP 10 * FROM TABLE
  27  	 var $fmtDate = "#Y-m-d#";
  28  	 var $fmtTimeStamp = "#Y-m-d h:i:sA#"; // note not comma
  29  	 var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
  30  	 var $sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
  31  	 var $sysTimeStamp = 'NOW';
  32  	 var $hasTransactions = false;
  33  	 var $upperCase = 'ucase';
  34  
  35  	function Time()
  36  	 {
  37  	 	 return time();
  38  	 }
  39  
  40  	function BeginTrans() { return false;}
  41  
  42  	function IfNull( $field, $ifNull )
  43  	 {
  44  	 	 return " IIF(IsNull($field), $ifNull, $field) "; // if Access
  45  	 }
  46  /*
  47  	 function MetaTables()
  48  	 {
  49  	 global $ADODB_FETCH_MODE;
  50  
  51  	 	 $savem = $ADODB_FETCH_MODE;
  52  	 	 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
  53  	 	 $qid = odbc_tables($this->_connectionID);
  54  	 	 $rs = new ADORecordSet_odbc($qid);
  55  	 	 $ADODB_FETCH_MODE = $savem;
  56  	 	 if (!$rs) return false;
  57  
  58  	 	 $arr = $rs->GetArray();
  59  	 	 //print_pre($arr);
  60  	 	 $arr2 = array();
  61  	 	 for ($i=0; $i < sizeof($arr); $i++) {
  62  	 	 	 if ($arr[$i][2] && $arr[$i][3] != 'SYSTEM TABLE')
  63  	 	 	 	 $arr2[] = $arr[$i][2];
  64  	 	 }
  65  	 	 return $arr2;
  66  	 }*/
  67  }
  68  
  69  
  70  class  ADORecordSet_access extends ADORecordSet_odbc {
  71  
  72  	 var $databaseType = "access";
  73  
  74  } // class
  75  
  76  }