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  /**
   4    @version   v5.21.0  2021-02-27
   5    @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
   6    @copyright (c) 2014      Damien Regad, Mark Newnham and the ADOdb community
   7    Released under both BSD license and Lesser GPL library license.
   8    Whenever there is any discrepancy between the two licenses,
   9    the BSD license will take precedence.
  10  
  11    Set tabs to 4 for best viewing.
  12  
  13  */
  14  
  15  // security - hide paths
  16  if (!defined('ADODB_DIR')) die();
  17  
  18  class ADODB2_access extends ADODB_DataDict {
  19  
  20  	 var $databaseType = 'access';
  21  	 var $seqField = false;
  22  
  23  
  24   	function ActualType($meta)
  25  	 {
  26  	 	 switch($meta) {
  27  	 	 case 'C': return 'TEXT';
  28  	 	 case 'XL':
  29  	 	 case 'X': return 'MEMO';
  30  
  31  	 	 case 'C2': return 'TEXT'; // up to 32K
  32  	 	 case 'X2': return 'MEMO';
  33  
  34  	 	 case 'B': return 'BINARY';
  35  
  36  	 	 case 'TS':
  37  	 	 case 'D': return 'DATETIME';
  38  	 	 case 'T': return 'DATETIME';
  39  
  40  	 	 case 'L': return 'BYTE';
  41  	 	 case 'I': return 'INTEGER';
  42  	 	 case 'I1': return 'BYTE';
  43  	 	 case 'I2': return 'SMALLINT';
  44  	 	 case 'I4': return 'INTEGER';
  45  	 	 case 'I8': return 'INTEGER';
  46  
  47  	 	 case 'F': return 'DOUBLE';
  48  	 	 case 'N': return 'NUMERIC';
  49  	 	 default:
  50  	 	 	 return $meta;
  51  	 	 }
  52  	 }
  53  
  54  	 // return string must begin with space
  55  	function _CreateSuffix($fname, &$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)
  56  	 {
  57  	 	 if ($fautoinc) {
  58  	 	 	 $ftype = 'COUNTER';
  59  	 	 	 return '';
  60  	 	 }
  61  	 	 if (substr($ftype,0,7) == 'DECIMAL') $ftype = 'DECIMAL';
  62  	 	 $suffix = '';
  63  	 	 if (strlen($fdefault)) {
  64  	 	 	 //$suffix .= " DEFAULT $fdefault";
  65  	 	 	 if ($this->debug) ADOConnection::outp("Warning: Access does not supported DEFAULT values (field $fname)");
  66  	 	 }
  67  	 	 if ($fnotnull) $suffix .= ' NOT NULL';
  68  	 	 if ($fconstraint) $suffix .= ' '.$fconstraint;
  69  	 	 return $suffix;
  70  	 }
  71  
  72  	function CreateDatabase($dbname,$options=false)
  73  	 {
  74  	 	 return array();
  75  	 }
  76  
  77  
  78  	function SetSchema($schema)
  79  	 {
  80  	 }
  81  
  82  	function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
  83  	 {
  84  	 	 if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
  85  	 	 return array();
  86  	 }
  87  
  88  
  89  	function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
  90  	 {
  91  	 	 if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
  92  	 	 return array();
  93  	 }
  94  
  95  }