From 3d3f8d3832921f99daf8ce1953304763c2e76c62 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 14 Apr 2006 06:22:09 +0000 Subject: Importing SQLMap + sample + docs. --- .../DataAccess/adodb/drivers/adodb-vfp.inc.php | 107 +++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 framework/DataAccess/adodb/drivers/adodb-vfp.inc.php (limited to 'framework/DataAccess/adodb/drivers/adodb-vfp.inc.php') diff --git a/framework/DataAccess/adodb/drivers/adodb-vfp.inc.php b/framework/DataAccess/adodb/drivers/adodb-vfp.inc.php new file mode 100644 index 00000000..b9a632f2 --- /dev/null +++ b/framework/DataAccess/adodb/drivers/adodb-vfp.inc.php @@ -0,0 +1,107 @@ +ADODB_odbc(); + } + + function Time() + { + return time(); + } + + function BeginTrans() { return false;} + + // quote string to be sent back to database + function qstr($s,$nofixquotes=false) + { + if (!$nofixquotes) return "'".str_replace("\r\n","'+chr(13)+'",str_replace("'",$this->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 ADORecordSet_vfp($id,$mode=false) + { + return $this->ADORecordSet_odbc($id,$mode); + } + + function MetaType($t,$len=-1) + { + 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 +?> \ No newline at end of file -- cgit v1.2.3