From 6854cb3f4d8219cf1829e32122eb2502a916eae9 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 1 Feb 2020 09:05:48 +0100 Subject: initial checkin --- vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php | 103 +++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php (limited to 'vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php') diff --git a/vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php b/vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php new file mode 100644 index 0000000..4a28884 --- /dev/null +++ b/vendor/adodb/adodb-php/drivers/adodb-vfp.inc.php @@ -0,0 +1,103 @@ +replaceQuote,$s))."'"; + return "'".$s."'"; + } + + + // TOP requires ORDER BY for VFP + function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0) + { + $this->hasTop = preg_match('/ORDER[ \t\r\n]+BY/is',$sql) ? 'top' : false; + $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache); + return $ret; + } + + + +}; + + +class ADORecordSet_vfp extends ADORecordSet_odbc { + + var $databaseType = "vfp"; + + + function __construct($id,$mode=false) + { + return parent::__construct($id,$mode); + } + + function MetaType($t, $len = -1, $fieldobj = false) + { + if (is_object($t)) { + $fieldobj = $t; + $t = $fieldobj->type; + $len = $fieldobj->max_length; + } + switch (strtoupper($t)) { + case 'C': + if ($len <= $this->blobSize) return 'C'; + case 'M': + return 'X'; + + case 'D': return 'D'; + + case 'T': return 'T'; + + case 'L': return 'L'; + + case 'I': return 'I'; + + default: return 'N'; + } + } +} + +} //define -- cgit v1.2.3-70-g09d2