]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/adodb/datadict/datadict-access.inc.php
Upgrade adodb
[SourceForge/phpwiki.git] / lib / WikiDB / adodb / datadict / datadict-access.inc.php
1 <?php
2
3 /**
4   V5.18 3 Sep 2012  (c) 2000-2012 John Lim (jlim#natsoft.com). 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 // security - hide paths
14 if (!defined('ADODB_DIR')) die();
15
16 class ADODB2_access extends ADODB_DataDict {
17         
18         var $databaseType = 'access';
19         var $seqField = false;
20         
21         
22         function ActualType($meta)
23         {
24                 switch($meta) {
25                 case 'C': return 'TEXT';
26                 case 'XL':
27                 case 'X': return 'MEMO'; 
28                 
29                 case 'C2': return 'TEXT'; // up to 32K
30                 case 'X2': return 'MEMO';
31                 
32                 case 'B': return 'BINARY';
33                 
34                 case 'TS':
35                 case 'D': return 'DATETIME';
36                 case 'T': return 'DATETIME';
37                 
38                 case 'L': return 'BYTE';
39                 case 'I': return 'INTEGER';
40                 case 'I1': return 'BYTE';
41                 case 'I2': return 'SMALLINT';
42                 case 'I4': return 'INTEGER';
43                 case 'I8': return 'INTEGER';
44                 
45                 case 'F': return 'DOUBLE';
46                 case 'N': return 'NUMERIC';
47                 default:
48                         return $meta;
49                 }
50         }
51         
52         // return string must begin with space
53         function _CreateSuffix($fname, &$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)
54         {
55                 if ($fautoinc) {
56                         $ftype = 'COUNTER';
57                         return '';
58                 }
59                 if (substr($ftype,0,7) == 'DECIMAL') $ftype = 'DECIMAL';
60                 $suffix = '';
61                 if (strlen($fdefault)) {
62                         //$suffix .= " DEFAULT $fdefault";
63                         if ($this->debug) ADOConnection::outp("Warning: Access does not supported DEFAULT values (field $fname)");
64                 }
65                 if ($fnotnull) $suffix .= ' NOT NULL';
66                 if ($fconstraint) $suffix .= ' '.$fconstraint;
67                 return $suffix;
68         }
69         
70         function CreateDatabase($dbname,$options=false)
71         {
72                 return array();
73         }
74         
75         
76         function SetSchema($schema)
77         {
78         }
79
80         function AlterColumnSQL($tabname, $flds)
81         {
82                 if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
83                 return array();
84         }
85         
86         
87         function DropColumnSQL($tabname, $flds)
88         {
89                 if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
90                 return array();
91         }
92         
93 }
94
95
96 ?>