diff options
author | wei <> | 2006-05-18 08:16:21 +0000 |
---|---|---|
committer | wei <> | 2006-05-18 08:16:21 +0000 |
commit | 1f8410794c8213d87227fabae2114a3be8033ece (patch) | |
tree | 68571a616595e5e01f32d68cb79b689dd02d2529 /framework/3rdParty/adodb/drivers/adodb-ado_mssql.inc.php | |
parent | 3d437d9dcd37dc901f53ca3322ba118851e3c676 (diff) |
Moved adodb to 3rdParty directory.
Diffstat (limited to 'framework/3rdParty/adodb/drivers/adodb-ado_mssql.inc.php')
-rw-r--r-- | framework/3rdParty/adodb/drivers/adodb-ado_mssql.inc.php | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/framework/3rdParty/adodb/drivers/adodb-ado_mssql.inc.php b/framework/3rdParty/adodb/drivers/adodb-ado_mssql.inc.php new file mode 100644 index 00000000..3a5e6914 --- /dev/null +++ b/framework/3rdParty/adodb/drivers/adodb-ado_mssql.inc.php @@ -0,0 +1,98 @@ +<?php +/* +V4.81 3 May 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved. + Released under both BSD license and Lesser GPL library license. + Whenever there is any discrepancy between the two licenses, + the BSD license will take precedence. +Set tabs to 4 for best viewing. + + Latest version is available at http://adodb.sourceforge.net + + Microsoft SQL Server ADO data driver. Requires ADO and MSSQL client. + Works only on MS Windows. + + It is normally better to use the mssql driver directly because it is much faster. + This file is only a technology demonstration and for test purposes. +*/ + +// security - hide paths +if (!defined('ADODB_DIR')) die(); + +if (!defined('_ADODB_ADO_LAYER')) { + if (PHP_VERSION >= 5) include(ADODB_DIR."/drivers/adodb-ado5.inc.php"); + else include(ADODB_DIR."/drivers/adodb-ado.inc.php"); +} + + +class ADODB_ado_mssql extends ADODB_ado { + var $databaseType = 'ado_mssql'; + var $hasTop = 'top'; + var $hasInsertID = true; + var $sysDate = 'convert(datetime,convert(char,GetDate(),102),102)'; + var $sysTimeStamp = 'GetDate()'; + var $leftOuter = '*='; + var $rightOuter = '=*'; + var $ansiOuter = true; // for mssql7 or later + var $substr = "substring"; + var $length = 'len'; + + //var $_inTransaction = 1; // always open recordsets, so no transaction problems. + + function ADODB_ado_mssql() + { + $this->ADODB_ado(); + } + + function _insertid() + { + return $this->GetOne('select @@identity'); + } + + function _affectedrows() + { + return $this->GetOne('select @@rowcount'); + } + + function MetaColumns($table) + { + $table = strtoupper($table); + $arr= array(); + $dbc = $this->_connectionID; + + $osoptions = array(); + $osoptions[0] = null; + $osoptions[1] = null; + $osoptions[2] = $table; + $osoptions[3] = null; + + $adors=@$dbc->OpenSchema(4, $osoptions);//tables + + if ($adors){ + while (!$adors->EOF){ + $fld = new ADOFieldObject(); + $c = $adors->Fields(3); + $fld->name = $c->Value; + $fld->type = 'CHAR'; // cannot discover type in ADO! + $fld->max_length = -1; + $arr[strtoupper($fld->name)]=$fld; + + $adors->MoveNext(); + } + $adors->Close(); + } + $false = false; + return empty($arr) ? $false : $arr; + } + + } // end class + + class ADORecordSet_ado_mssql extends ADORecordSet_ado { + + var $databaseType = 'ado_mssql'; + + function ADORecordSet_ado_mssql($id,$mode=false) + { + return $this->ADORecordSet_ado($id,$mode); + } +} +?>
\ No newline at end of file |