[2] | 1 | <?php |
---|
| 2 | /* |
---|
[34] | 3 | V4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved. |
---|
[2] | 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://adodb.sourceforge.net |
---|
| 10 | |
---|
| 11 | Microsoft Access data driver. Requires ODBC. Works only on MS Windows. |
---|
| 12 | */ |
---|
| 13 | if (!defined('_ADODB_ODBC_LAYER')) { |
---|
| 14 | if (!defined('ADODB_DIR')) die(); |
---|
| 15 | |
---|
| 16 | include(ADODB_DIR."/drivers/adodb-odbc.inc.php"); |
---|
| 17 | } |
---|
| 18 | if (!defined('_ADODB_ACCESS')) { |
---|
| 19 | define('_ADODB_ACCESS',1); |
---|
| 20 | |
---|
| 21 | class ADODB_access extends ADODB_odbc { |
---|
| 22 | var $databaseType = 'access'; |
---|
| 23 | var $hasTop = 'top'; // support mssql SELECT TOP 10 * FROM TABLE |
---|
| 24 | var $fmtDate = "#Y-m-d#"; |
---|
| 25 | var $fmtTimeStamp = "#Y-m-d h:i:sA#"; // note not comma |
---|
| 26 | var $_bindInputArray = false; // strangely enough, setting to true does not work reliably |
---|
| 27 | var $sysDate = "FORMAT(NOW,'yyyy-mm-dd')"; |
---|
| 28 | var $sysTimeStamp = 'NOW'; |
---|
| 29 | var $hasTransactions = false; |
---|
[34] | 30 | var $upperCase = 'ucase'; |
---|
[2] | 31 | |
---|
| 32 | function ADODB_access() |
---|
| 33 | { |
---|
| 34 | global $ADODB_EXTENSION; |
---|
| 35 | |
---|
| 36 | $ADODB_EXTENSION = false; |
---|
| 37 | $this->ADODB_odbc(); |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | function Time() |
---|
| 41 | { |
---|
| 42 | return time(); |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | function BeginTrans() { return false;} |
---|
| 46 | |
---|
| 47 | function IfNull( $field, $ifNull ) |
---|
| 48 | { |
---|
| 49 | return " IIF(IsNull($field), $ifNull, $field) "; // if Access |
---|
| 50 | } |
---|
| 51 | /* |
---|
| 52 | function &MetaTables() |
---|
| 53 | { |
---|
| 54 | global $ADODB_FETCH_MODE; |
---|
| 55 | |
---|
| 56 | $savem = $ADODB_FETCH_MODE; |
---|
| 57 | $ADODB_FETCH_MODE = ADODB_FETCH_NUM; |
---|
| 58 | $qid = odbc_tables($this->_connectionID); |
---|
| 59 | $rs = new ADORecordSet_odbc($qid); |
---|
| 60 | $ADODB_FETCH_MODE = $savem; |
---|
| 61 | if (!$rs) return false; |
---|
| 62 | |
---|
| 63 | $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change; |
---|
| 64 | |
---|
| 65 | $arr = &$rs->GetArray(); |
---|
| 66 | //print_pre($arr); |
---|
| 67 | $arr2 = array(); |
---|
| 68 | for ($i=0; $i < sizeof($arr); $i++) { |
---|
| 69 | if ($arr[$i][2] && $arr[$i][3] != 'SYSTEM TABLE') |
---|
| 70 | $arr2[] = $arr[$i][2]; |
---|
| 71 | } |
---|
| 72 | return $arr2; |
---|
| 73 | }*/ |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | class ADORecordSet_access extends ADORecordSet_odbc { |
---|
| 78 | |
---|
| 79 | var $databaseType = "access"; |
---|
| 80 | |
---|
| 81 | function ADORecordSet_access($id,$mode=false) |
---|
| 82 | { |
---|
| 83 | return $this->ADORecordSet_odbc($id,$mode); |
---|
| 84 | } |
---|
| 85 | }// class |
---|
| 86 | } |
---|
| 87 | ?> |
---|