Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
/**
3
 * Microsoft Access driver.
4
 *
5
 * Requires ODBC. Works only on Microsoft Windows.
6
 *
7
 * This file is part of ADOdb, a Database Abstraction Layer library for PHP.
8
 *
9
 * @package ADOdb
10
 * @link https://adodb.org Project's web site and documentation
11
 * @link https://github.com/ADOdb/ADOdb Source code and issue tracker
12
 *
13
 * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause
14
 * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option,
15
 * any later version. This means you can use it in proprietary products.
16
 * See the LICENSE.md file distributed with this source code for details.
17
 * @license BSD-3-Clause
18
 * @license LGPL-2.1-or-later
19
 *
20
 * @copyright 2000-2013 John Lim
21
 * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community
22
 */
23
 
24
if (!defined('_ADODB_ODBC_LAYER')) {
25
	if (!defined('ADODB_DIR')) die();
26
 
27
	include_once(ADODB_DIR."/drivers/adodb-odbc.inc.php");
28
}
29
 
30
if (!defined('_ADODB_ACCESS')) {
31
	define('_ADODB_ACCESS',1);
32
 
33
class  ADODB_access extends ADODB_odbc {
34
	var $databaseType = 'access';
35
	var $hasTop = 'top';		// support mssql SELECT TOP 10 * FROM TABLE
36
	var $fmtDate = "#Y-m-d#";
37
	var $fmtTimeStamp = "#Y-m-d h:i:sA#"; // note not comma
38
	var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
39
	var $sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
40
	var $sysTimeStamp = 'NOW';
41
	var $hasTransactions = false;
42
	var $upperCase = 'ucase';
43
 
44
	function Time()
45
	{
46
		return time();
47
	}
48
 
49
	function BeginTrans() { return false;}
50
 
51
	function IfNull( $field, $ifNull )
52
	{
53
		return " IIF(IsNull($field), $ifNull, $field) "; // if Access
54
	}
55
/*
56
	function MetaTables()
57
	{
58
	global $ADODB_FETCH_MODE;
59
 
60
		$savem = $ADODB_FETCH_MODE;
61
		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
62
		$qid = odbc_tables($this->_connectionID);
63
		$rs = new ADORecordSet_odbc($qid);
64
		$ADODB_FETCH_MODE = $savem;
65
		if (!$rs) return false;
66
 
67
		$arr = $rs->GetArray();
68
		//print_pre($arr);
69
		$arr2 = array();
70
		for ($i=0; $i < sizeof($arr); $i++) {
71
			if ($arr[$i][2] && $arr[$i][3] != 'SYSTEM TABLE')
72
				$arr2[] = $arr[$i][2];
73
		}
74
		return $arr2;
75
	}*/
76
}
77
 
78
 
79
class  ADORecordSet_access extends ADORecordSet_odbc {
80
 
81
	var $databaseType = "access";
82
 
83
} // class
84
 
85
}