This Domain(Admin5.com) is for Sale:

oracle database access object

时间:2007-12-23  来源:不详  作者:迈克DB


if(!($this->conn = OCILogon($user, $pass, $db))){

$this->err_no=106;
$this->err="Error 106: Failed to logon.";
return FALSE;
};

return TRUE;

}
function Open($sql="") file://$this->CmdString
{
if($this->conn=="") {
$this->err_no=100;
$this->err="Error 100,Connection Object Required.";
return FALSE;
}

if($sql=="" and $this->CmdString=="") {
$this->err_no=101;
$this->err="Error 101,SQL Statement Required.";
return FALSE;
}
if($sql=="")
$sql=$this->CmdString;
if(!($cursor=OCIParse($this->conn,$sql))) {
$this->err_no=102;
$this->err="Server Internal Error: Failed to parse SQL Statement.";
return FALSE;

内容来自dedecms


}

if(!OCIExecute($cursor)){
$this->err_no=103;
$this->err="Server Internal Error: Failed to execute SQL Statement.";
return FALSE;
}
$this->Rows=0;
while(OCIFetchInto($cursor,$this->RS[$this->Rows])){

$this->Rows ;

}
$this->Cols=OCINumCols($cursor);

if($this->Rows==0) {

$this->err_no=104;
$this->err="Warning: No rows affectted.RS result is not available.";
}

OCIFreeStatement($cursor);

return TRUE;
}


function Execute($sql="") {
if($this->conn=="") {
$this->err_no=100;
$this->err="Error 100,Connection Object Required.";
return FALSE;
}

if($sql=="" and $this->CmdString=="") {
$this->err_no=101; 本文来自织梦
$this->err="Error 101,SQL Statement Required.";
return FALSE;
}
if($sql=="")
$sql=$this->CmdString;

if(!($cursor=OCIParse($this->conn,$sql))) {
$this->err_no=102;
$this->err="Server Internal Error: Failed to parse SQL Statement.";
return FALSE;
}


if(!OCIExecute($cursor)){
$this->err_no=103;
$this->err="Server Internal Error: Failed to execute SQL Statement.";
return FALSE;
}
$this->Rows=OCIRowCount($cursor);
OCIFreeStatement($cursor);

return TRUE;
}
function LogOff(){

if(!OCILogoff($conn)){

$this->err_no=105;
$this->err="Server Internal Error: Failed to logoff database.";
return FALSE;
}
return TRUE;

}
}

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息