| 36 |
kaklik |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
V4.80 8 Mar 2006 (c) 2000-2006 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 |
// 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 'D': return 'DATETIME';
|
|
|
35 |
case 'T': return 'DATETIME';
|
|
|
36 |
|
|
|
37 |
case 'L': return 'BYTE';
|
|
|
38 |
case 'I': return 'INTEGER';
|
|
|
39 |
case 'I1': return 'BYTE';
|
|
|
40 |
case 'I2': return 'SMALLINT';
|
|
|
41 |
case 'I4': return 'INTEGER';
|
|
|
42 |
case 'I8': return 'INTEGER';
|
|
|
43 |
|
|
|
44 |
case 'F': return 'DOUBLE';
|
|
|
45 |
case 'N': return 'NUMERIC';
|
|
|
46 |
default:
|
|
|
47 |
return $meta;
|
|
|
48 |
}
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
// return string must begin with space
|
|
|
52 |
function _CreateSuffix($fname, &$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint)
|
|
|
53 |
{
|
|
|
54 |
if ($fautoinc) {
|
|
|
55 |
$ftype = 'COUNTER';
|
|
|
56 |
return '';
|
|
|
57 |
}
|
|
|
58 |
if (substr($ftype,0,7) == 'DECIMAL') $ftype = 'DECIMAL';
|
|
|
59 |
$suffix = '';
|
|
|
60 |
if (strlen($fdefault)) {
|
|
|
61 |
//$suffix .= " DEFAULT $fdefault";
|
|
|
62 |
if ($this->debug) ADOConnection::outp("Warning: Access does not supported DEFAULT values (field $fname)");
|
|
|
63 |
}
|
|
|
64 |
if ($fnotnull) $suffix .= ' NOT NULL';
|
|
|
65 |
if ($fconstraint) $suffix .= ' '.$fconstraint;
|
|
|
66 |
return $suffix;
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
function CreateDatabase($dbname,$options=false)
|
|
|
70 |
{
|
|
|
71 |
return array();
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
function SetSchema($schema)
|
|
|
76 |
{
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
function AlterColumnSQL($tabname, $flds)
|
|
|
80 |
{
|
|
|
81 |
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
|
|
|
82 |
return array();
|
|
|
83 |
}
|
|
|
84 |
|
|
|
85 |
|
|
|
86 |
function DropColumnSQL($tabname, $flds)
|
|
|
87 |
{
|
|
|
88 |
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
|
|
|
89 |
return array();
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
?>
|