Documentation TYPO3 par Ameos

adodb-ado_mssql.inc.php

00001 <?php
00002 /* 
00003 V4.80 8 Mar 2006  (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
00004   Released under both BSD license and Lesser GPL library license. 
00005   Whenever there is any discrepancy between the two licenses, 
00006   the BSD license will take precedence. 
00007 Set tabs to 4 for best viewing.
00008   
00009   Latest version is available at http://adodb.sourceforge.net
00010   
00011   Microsoft SQL Server ADO data driver. Requires ADO and MSSQL client. 
00012   Works only on MS Windows.
00013   
00014   It is normally better to use the mssql driver directly because it is much faster. 
00015   This file is only a technology demonstration and for test purposes.
00016 */
00017 
00018 // security - hide paths
00019 if (!defined('ADODB_DIR')) die();
00020 
00021 if (!defined('_ADODB_ADO_LAYER')) {
00022         if (PHP_VERSION >= 5) include(ADODB_DIR."/drivers/adodb-ado5.inc.php");
00023         else include(ADODB_DIR."/drivers/adodb-ado.inc.php");
00024 }
00025 
00026 
00027 class  ADODB_ado_mssql extends ADODB_ado {        
00028         var $databaseType = 'ado_mssql';
00029         var $hasTop = 'top';
00030         var $hasInsertID = true;
00031         var $sysDate = 'convert(datetime,convert(char,GetDate(),102),102)';
00032         var $sysTimeStamp = 'GetDate()';
00033         var $leftOuter = '*=';
00034         var $rightOuter = '=*';
00035         var $ansiOuter = true; // for mssql7 or later
00036         var $substr = "substring";
00037         var $length = 'len';
00038         
00039         //var $_inTransaction = 1; // always open recordsets, so no transaction problems.
00040         
00041         function ADODB_ado_mssql()
00042         {
00043                 $this->ADODB_ado();
00044         }
00045         
00046         function _insertid()
00047         {
00048                 return $this->GetOne('select @@identity');
00049         }
00050         
00051         function _affectedrows()
00052         {
00053                 return $this->GetOne('select @@rowcount');
00054         }
00055         
00056         function MetaColumns($table)
00057         {
00058         $table = strtoupper($table);
00059         $arr= array();
00060         $dbc = $this->_connectionID;
00061         
00062         $osoptions = array();
00063         $osoptions[0] = null;
00064         $osoptions[1] = null;
00065         $osoptions[2] = $table;
00066         $osoptions[3] = null;
00067         
00068         $adors=@$dbc->OpenSchema(4, $osoptions);//tables
00069 
00070         if ($adors){
00071                 while (!$adors->EOF){
00072                         $fld = new ADOFieldObject();
00073                         $c = $adors->Fields(3);
00074                         $fld->name = $c->Value;
00075                         $fld->type = 'CHAR'; // cannot discover type in ADO!
00076                         $fld->max_length = -1;
00077                         $arr[strtoupper($fld->name)]=$fld;
00078         
00079                         $adors->MoveNext();
00080                 }
00081                 $adors->Close();
00082         }
00083         $false = false;
00084                 return empty($arr) ? $false : $arr;
00085         }
00086         
00087         } // end class 
00088         
00089         class  ADORecordSet_ado_mssql extends ADORecordSet_ado {        
00090         
00091         var $databaseType = 'ado_mssql';
00092         
00093         function ADORecordSet_ado_mssql($id,$mode=false)
00094         {
00095                 return $this->ADORecordSet_ado($id,$mode);
00096         }
00097 }
00098 ?>


Généré par Les experts TYPO3 avec  doxygen 1.4.6