]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/adodb/drivers/adodb-access.inc.php
trailing_spaces
[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         var $databaseType = 'access';
21         var $hasTop = 'top';            // support mssql SELECT TOP 10 * FROM TABLE
22         var $fmtDate = "#Y-m-d#";
23         var $fmtTimeStamp = "#Y-m-d h:i:sA#"; // note not comma
24         var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
25         var $sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
26         var $sysTimeStamp = 'NOW';
27         var $hasTransactions = false;
28
29         function ADODB_access()
30         {
31         global $ADODB_EXTENSION;
32
33                 $ADODB_EXTENSION = false;
34                 $this->ADODB_odbc();
35         }
36
37         function Time()
38         {
39                 return time();
40         }
41
42         function BeginTrans() { return false;}
43
44         function IfNull( $field, $ifNull )
45         {
46                 return " IIF(IsNull($field), $ifNull, $field) "; // if Access
47         }
48 /*
49         function &MetaTables()
50         {
51         global $ADODB_FETCH_MODE;
52
53                 $savem = $ADODB_FETCH_MODE;
54                 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
55                 $qid = odbc_tables($this->_connectionID);
56                 $rs = new ADORecordSet_odbc($qid);
57                 $ADODB_FETCH_MODE = $savem;
58                 if (!$rs) return false;
59
60                 $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
61
62                 $arr = &$rs->GetArray();
63                 //print_pre($arr);
64                 $arr2 = array();
65                 for ($i=0; $i < sizeof($arr); $i++) {
66                         if ($arr[$i][2] && $arr[$i][3] != 'SYSTEM TABLE')
67                                 $arr2[] = $arr[$i][2];
68                 }
69                 return $arr2;
70         }*/
71 }
72
73
74 class  ADORecordSet_access extends ADORecordSet_odbc {
75
76         var $databaseType = "access";
77
78         function ADORecordSet_access($id,$mode=false)
79         {
80                 return $this->ADORecordSet_odbc($id,$mode);
81         }
82 }// class
83 }
84 ?>