当前位置: 首页>>代码示例>>PHP>>正文


PHP COM::CreateParameter方法代码示例

本文整理汇总了PHP中COM::CreateParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP COM::CreateParameter方法的具体用法?PHP COM::CreateParameter怎么用?PHP COM::CreateParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在COM的用法示例。


在下文中一共展示了COM::CreateParameter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: COM

 function &_query($sql, $inputarr = false)
 {
     try {
         // In PHP5, all COM errors are exceptions, so to maintain old behaviour...
         $dbc = $this->_connectionID;
         //	return rs
         if ($inputarr) {
             if (!empty($this->charPage)) {
                 $oCmd = new COM('ADODB.Command', null, $this->charPage);
             } else {
                 $oCmd = new COM('ADODB.Command');
             }
             $oCmd->ActiveConnection = $dbc;
             $oCmd->CommandText = $sql;
             $oCmd->CommandType = 1;
             foreach ($inputarr as $val) {
                 // name, type, direction 1 = input, len,
                 $this->adoParameterType = 130;
                 $p = $oCmd->CreateParameter('name', $this->adoParameterType, 1, strlen($val), $val);
                 //print $p->Type.' '.$p->value;
                 $oCmd->Parameters->Append($p);
             }
             $p = false;
             $rs = $oCmd->Execute();
             $e = $dbc->Errors;
             if ($dbc->Errors->Count > 0) {
                 return false;
             }
             return $rs;
         }
         $rs = @$dbc->Execute($sql, $this->_affectedRows, $this->_execute_option);
         if ($dbc->Errors->Count > 0) {
             return false;
         }
         if (!$rs) {
             return false;
         }
         if ($rs->State == 0) {
             return true;
         }
         // 0 = adStateClosed means no records returned
         return $rs;
     } catch (exception $e) {
     }
     return false;
 }
开发者ID:centaurustech,项目名称:BenFund,代码行数:46,代码来源:adodb-ado5.inc.php

示例2: COM

	function _query($sql,$inputarr=false)
	{
		try { // In PHP5, all COM errors are exceptions, so to maintain old behaviour...

		$dbc = $this->_connectionID;

	//	return rs

		$false = false;

		if ($inputarr) {

			if (!empty($this->charPage))
				$oCmd = new COM('ADODB.Command',null,$this->charPage);
			else
				$oCmd = new COM('ADODB.Command');
			$oCmd->ActiveConnection = $dbc;
			$oCmd->CommandText = $sql;
			$oCmd->CommandType = 1;

			while(list(, $val) = each($inputarr)) {
				$type = gettype($val);
				$len=strlen($val);
				if ($type == 'boolean')
					$this->adoParameterType = 11;
				else if ($type == 'integer')
					$this->adoParameterType = 3;
				else if ($type == 'double')
					$this->adoParameterType = 5;
				elseif ($type == 'string')
					$this->adoParameterType = 202;
				else if (($val === null) || (!defined($val)))
					$len=1;
				else
					$this->adoParameterType = 130;

				// name, type, direction 1 = input, len,
        		$p = $oCmd->CreateParameter('name',$this->adoParameterType,1,$len,$val);

				$oCmd->Parameters->Append($p);
			}

			$p = false;
			$rs = $oCmd->Execute();
			$e = $dbc->Errors;
			if ($dbc->Errors->Count > 0) return $false;
			return $rs;
		}

		$rs = @$dbc->Execute($sql,$this->_affectedRows, $this->_execute_option);

		if ($dbc->Errors->Count > 0) return $false;
		if (! $rs) return $false;

		if ($rs->State == 0) {
			$true = true;
			return $true; // 0 = adStateClosed means no records returned
		}
		return $rs;

		} catch (exception $e) {

		}
		return $false;
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:65,代码来源:adodb-ado5.inc.php

示例3: COM

 function _query($sql, $inputarr = false)
 {
     $dbc = $this->_connectionID;
     $false = false;
     //	return rs
     if ($inputarr) {
         if (!empty($this->charPage)) {
             $oCmd = new COM('ADODB.Command', null, $this->charPage);
         } else {
             $oCmd = new COM('ADODB.Command');
         }
         $oCmd->ActiveConnection = $dbc;
         $oCmd->CommandText = $sql;
         $oCmd->CommandType = 1;
         // Map by http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcreateparam.asp
         // Check issue http://bugs.php.net/bug.php?id=40664 !!!
         while (list(, $val) = each($inputarr)) {
             $type = gettype($val);
             $len = strlen($val);
             if ($type == 'boolean') {
                 $this->adoParameterType = 11;
             } else {
                 if ($type == 'integer') {
                     $this->adoParameterType = 3;
                 } else {
                     if ($type == 'double') {
                         $this->adoParameterType = 5;
                     } elseif ($type == 'string') {
                         $this->adoParameterType = 202;
                     } else {
                         if ($val === null || !defined($val)) {
                             $len = 1;
                         } else {
                             $this->adoParameterType = 130;
                         }
                     }
                 }
             }
             // name, type, direction 1 = input, len,
             $p = $oCmd->CreateParameter('name', $this->adoParameterType, 1, $len, $val);
             $oCmd->Parameters->Append($p);
         }
         $p = false;
         $rs = $oCmd->Execute();
         $e = $dbc->Errors;
         if ($dbc->Errors->Count > 0) {
             return $false;
         }
         return $rs;
     }
     $rs = @$dbc->Execute($sql, $this->_affectedRows, $this->_execute_option);
     if ($dbc->Errors->Count > 0) {
         return $false;
     }
     if (!$rs) {
         return $false;
     }
     if ($rs->State == 0) {
         $true = true;
         return $true;
         // 0 = adStateClosed means no records returned
     }
     return $rs;
 }
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:64,代码来源:adodb-ado.inc.php

示例4: COM

 function _query($sql, $inputarr = false)
 {
     $dbc = $this->_connectionID;
     $false = false;
     if ($inputarr) {
         if (!empty($this->charPage)) {
             $oCmd = new COM('ADODB.Command', null, $this->charPage);
         } else {
             $oCmd = new COM('ADODB.Command');
         }
         $oCmd->ActiveConnection = $dbc;
         $oCmd->CommandText = $sql;
         $oCmd->CommandType = 1;
         foreach ($inputarr as $val) {
             $this->adoParameterType = 130;
             $p = $oCmd->CreateParameter('name', $this->adoParameterType, 1, strlen($val), $val);
             $oCmd->Parameters->Append($p);
         }
         $p = false;
         $rs = $oCmd->Execute();
         $e = $dbc->Errors;
         if (0 < $dbc->Errors->Count) {
             return $false;
         }
         return $rs;
     }
     $rs = @$dbc->Execute($sql, $this->_affectedRows, $this->_execute_option);
     if (0 < $dbc->Errors->Count) {
         return $false;
     }
     if (!$rs) {
         return $false;
     }
     if ($rs->State == 0) {
         $true = true;
         return $true;
     }
     return $rs;
 }
开发者ID:antiwise,项目名称:collect,代码行数:39,代码来源:adodb-ado.inc.php

示例5: COM

	function &_query($sql,$inputarr=false) 
	{
		
		$dbc = $this->_connectionID;
		$false = false;
		
	//	return rs	
		if ($inputarr) {
			
			if (!empty($this->charPage))
				$oCmd = new COM('ADODB.Command',null,$this->charPage);
			else
				$oCmd = new COM('ADODB.Command');
			$oCmd->ActiveConnection = $dbc;
			$oCmd->CommandText = $sql;
			$oCmd->CommandType = 1;

			foreach($inputarr as $val) {
				// name, type, direction 1 = input, len,
				$this->adoParameterType = 130;
				$p = $oCmd->CreateParameter('name',$this->adoParameterType,1,strlen($val),$val);
				//print $p->Type.' '.$p->value;
				$oCmd->Parameters->Append($p);
			}
			$p = false;
			$rs = $oCmd->Execute();
			$e = $dbc->Errors;
			if ($dbc->Errors->Count > 0) return $false;
			return $rs;
		}
		
		$rs = @$dbc->Execute($sql,$this->_affectedRows, $this->_execute_option);

		if ($dbc->Errors->Count > 0) return $false;
		if (! $rs) return $false;
		
		if ($rs->State == 0) {
			$true = true;
			return $true; // 0 = adStateClosed means no records returned
		}
		return $rs;
	}
开发者ID:joeymetal,项目名称:v1,代码行数:42,代码来源:adodb-ado.inc.php

示例6: COM

 function &_query($sql, $inputarr = false)
 {
     $dbc = $this->_connectionID;
     //	return rs
     if ($inputarr) {
         $oCmd = new COM('ADODB.Command');
         $oCmd->ActiveConnection = $dbc;
         $oCmd->CommandText = $sql;
         $oCmd->CommandType = 1;
         foreach ($inputarr as $val) {
             // name, type, direction 1 = input, len,
             $this->adoParameterType = 130;
             $p = $oCmd->CreateParameter('name', $this->adoParameterType, 1, strlen($val), $val);
             //print $p->Type.' '.$p->value;
             $oCmd->Parameters->Append($p);
         }
         $p = false;
         $rs = $oCmd->Execute();
         $e = $dbc->Errors;
         if ($dbc->Errors->Count > 0) {
             return false;
         }
         return $rs;
     }
     $rs = @$dbc->Execute($sql, $this->_affectedRows);
     if ($dbc->Errors->Count > 0) {
         return false;
     }
     return $rs;
 }
开发者ID:qoire,项目名称:portal,代码行数:30,代码来源:adodb-ado.inc.php


注:本文中的COM::CreateParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。