00001 <?php
00002
00013
00014 if (!defined('ADODB_DIR')) die();
00015
00016 class ADODB2_access extends ADODB_DataDict {
00017
00018 var $databaseType = 'access';
00019 var $seqField = false;
00020
00021
00022 function ActualType($meta)
00023 {
00024 switch($meta) {
00025 case 'C': return 'TEXT';
00026 case 'XL':
00027 case 'X': return 'MEMO';
00028
00029 case 'C2': return 'TEXT';
00030 case 'X2': return 'MEMO';
00031
00032 case 'B': return 'BINARY';
00033
00034 case 'D': return 'DATETIME';
00035 case 'T': return 'DATETIME';
00036
00037 case 'L': return 'BYTE';
00038 case 'I': return 'INTEGER';
00039 case 'I1': return 'BYTE';
00040 case 'I2': return 'SMALLINT';
00041 case 'I4': return 'INTEGER';
00042 case 'I8': return 'INTEGER';
00043
00044 case 'F': return 'DOUBLE';
00045 case 'N': return 'NUMERIC';
00046 default:
00047 return $meta;
00048 }
00049 }
00050
00051
00052 function _CreateSuffix($fname, &$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint)
00053 {
00054 if ($fautoinc) {
00055 $ftype = 'COUNTER';
00056 return '';
00057 }
00058 if (substr($ftype,0,7) == 'DECIMAL') $ftype = 'DECIMAL';
00059 $suffix = '';
00060 if (strlen($fdefault)) {
00061
00062 if ($this->debug) ADOConnection::outp("Warning: Access does not supported DEFAULT values (field $fname)");
00063 }
00064 if ($fnotnull) $suffix .= ' NOT NULL';
00065 if ($fconstraint) $suffix .= ' '.$fconstraint;
00066 return $suffix;
00067 }
00068
00069 function CreateDatabase($dbname,$options=false)
00070 {
00071 return array();
00072 }
00073
00074
00075 function SetSchema($schema)
00076 {
00077 }
00078
00079 function AlterColumnSQL($tabname, $flds)
00080 {
00081 if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
00082 return array();
00083 }
00084
00085
00086 function DropColumnSQL($tabname, $flds)
00087 {
00088 if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
00089 return array();
00090 }
00091
00092 }
00093
00094
00095 ?>