3 V5.16 26 Mar 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). 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 = false ; // 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 $ret = ADOConnection
::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
70 class ADORecordSet_vfp
extends ADORecordSet_odbc
{
72 var $databaseType = "vfp";
75 function ADORecordSet_vfp($id,$mode=false)
77 return $this->ADORecordSet_odbc($id,$mode);
80 function MetaType($t,$len=-1)
85 $len = $fieldobj->max_length
;
87 switch (strtoupper($t)) {
89 if ($len <= $this->blobSize
) return 'C';