]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/adodb/drivers/adodb-access.inc.php
Reformat code
[SourceForge/phpwiki.git] / lib / WikiDB / adodb / drivers / adodb-access.inc.php
1 <?php
2 /*
3 V4.22 15 Apr 2004  (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
4   Released under both BSD license and Lesser GPL library license.
5   Whenever there is any discrepancy between the two licenses,
6   the BSD license will take precedence. See License.txt.
7   Set tabs to 4 for best viewing.
8
9   Latest version is available at http://php.weblogs.com/
10
11   Microsoft Access data driver. Requires ODBC. Works only on MS Windows.
12 */
13 if (!defined('_ADODB_ODBC_LAYER')) {
14     include(ADODB_DIR . "/drivers/adodb-odbc.inc.php");
15 }
16 if (!defined('_ADODB_ACCESS')) {
17     define('_ADODB_ACCESS', 1);
18
19     class  ADODB_access extends ADODB_odbc
20     {
21         var $databaseType = 'access';
22         var $hasTop = 'top'; // support mssql SELECT TOP 10 * FROM TABLE
23         var $fmtDate = "#Y-m-d#";
24         var $fmtTimeStamp = "#Y-m-d h:i:sA#"; // note not comma
25         var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
26         var $sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
27         var $sysTimeStamp = 'NOW';
28         var $hasTransactions = false;
29
30         function ADODB_access()
31         {
32             global $ADODB_EXTENSION;
33
34             $ADODB_EXTENSION = false;
35             $this->ADODB_odbc();
36         }
37
38         function Time()
39         {
40             return time();
41         }
42
43         function BeginTrans()
44         {
45             return false;
46         }
47
48         function IfNull($field, $ifNull)
49         {
50             return " IIF(IsNull($field), $ifNull, $field) "; // if Access
51         }
52         /*
53             function &MetaTables()
54             {
55             global $ADODB_FETCH_MODE;
56
57                 $savem = $ADODB_FETCH_MODE;
58                 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
59                 $qid = odbc_tables($this->_connectionID);
60                 $rs = new ADORecordSet_odbc($qid);
61                 $ADODB_FETCH_MODE = $savem;
62                 if (!$rs) return false;
63
64                 $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
65
66                 $arr = &$rs->GetArray();
67                 //print_pre($arr);
68                 $arr2 = array();
69                 for ($i=0; $i < sizeof($arr); $i++) {
70                     if ($arr[$i][2] && $arr[$i][3] != 'SYSTEM TABLE')
71                         $arr2[] = $arr[$i][2];
72                 }
73                 return $arr2;
74             }*/
75     }
76
77     class  ADORecordSet_access extends ADORecordSet_odbc
78     {
79
80         var $databaseType = "access";
81
82         function ADORecordSet_access($id, $mode = false)
83         {
84             return $this->ADORecordSet_odbc($id, $mode);
85         }
86     }
87     // class
88 }