3
V4.20 22 Feb 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.
7
Set tabs to 4 for best viewing.
9
Latest version is available at http://php.weblogs.com/
11
Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
14
if (!defined('_ADODB_ODBC_LAYER')) {
15
include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
17
if (!defined('ADODB_VFP')){
18
define('ADODB_VFP',1);
19
class ADODB_vfp extends ADODB_odbc {
20
var $databaseType = "vfp";
21
var $fmtDate = "{^Y-m-d}";
22
var $fmtTimeStamp = "{^Y-m-d, h:i:sA}";
23
var $replaceQuote = "'+chr(39)+'" ;
26
var $hasTop = 'top'; // support mssql SELECT TOP 10 * FROM TABLE
27
var $upperCase = 'upper';
28
var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
29
var $sysTimeStamp = 'datetime()';
30
var $sysDate = 'date()';
31
var $ansiOuter = true;
32
var $hasTransactions = false;
33
var $curmode = SQL_CUR_USE_ODBC ; // See sqlext.h, SQL_CUR_DEFAULT == SQL_CUR_USE_DRIVER == 2L
40
function BeginTrans() { return false;}
42
// quote string to be sent back to database
43
function qstr($s,$nofixquotes=false)
45
if (!$nofixquotes) return "'".str_replace("\r\n","'+chr(13)+'",str_replace("'",$this->replaceQuote,$s))."'";
50
// TOP requires ORDER BY for VFP
51
function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
53
if (!preg_match('/ORDER[ \t\r\n]+BY/is',$sql)) $sql .= ' ORDER BY 1';
54
return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
61
class ADORecordSet_vfp extends ADORecordSet_odbc {
63
var $databaseType = "vfp";
66
function ADORecordSet_vfp($id,$mode=false)
68
return $this->ADORecordSet_odbc($id,$mode);
71
function MetaType($t,$len=-1)
76
$len = $fieldobj->max_length;
78
switch (strtoupper($t)) {
80
if ($len <= $this->blobSize) return 'C';
3
V4.51 29 July 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.
7
Set tabs to 4 for best viewing.
9
Latest version is available at http://adodb.sourceforge.net
11
Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
14
// security - hide paths
15
if (!defined('ADODB_DIR')) die();
17
if (!defined('_ADODB_ODBC_LAYER')) {
18
include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
20
if (!defined('ADODB_VFP')){
21
define('ADODB_VFP',1);
22
class ADODB_vfp extends ADODB_odbc {
23
var $databaseType = "vfp";
24
var $fmtDate = "{^Y-m-d}";
25
var $fmtTimeStamp = "{^Y-m-d, h:i:sA}";
26
var $replaceQuote = "'+chr(39)+'" ;
29
var $hasTop = 'top'; // support mssql SELECT TOP 10 * FROM TABLE
30
var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
31
var $sysTimeStamp = 'datetime()';
32
var $sysDate = 'date()';
33
var $ansiOuter = true;
34
var $hasTransactions = false;
35
var $curmode = SQL_CUR_USE_ODBC ; // See sqlext.h, SQL_CUR_DEFAULT == SQL_CUR_USE_DRIVER == 2L
47
function BeginTrans() { return false;}
49
// quote string to be sent back to database
50
function qstr($s,$nofixquotes=false)
52
if (!$nofixquotes) return "'".str_replace("\r\n","'+chr(13)+'",str_replace("'",$this->replaceQuote,$s))."'";
57
// TOP requires ORDER BY for VFP
58
function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
60
$this->hasTop = preg_match('/ORDER[ \t\r\n]+BY/is',$sql) ? 'top' : false;
61
return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
69
class ADORecordSet_vfp extends ADORecordSet_odbc {
71
var $databaseType = "vfp";
74
function ADORecordSet_vfp($id,$mode=false)
76
return $this->ADORecordSet_odbc($id,$mode);
79
function MetaType($t,$len=-1)
84
$len = $fieldobj->max_length;
86
switch (strtoupper($t)) {
88
if ($len <= $this->blobSize) return 'C';
b'\\ No newline at end of file'