home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / datadict-access.inc.php < prev    next >
Encoding:
PHP Script  |  2004-03-20  |  2.0 KB  |  92 lines

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