• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP odbtp_connect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中odbtp_connect函数的典型用法代码示例。如果您正苦于以下问题:PHP odbtp_connect函数的具体用法?PHP odbtp_connect怎么用?PHP odbtp_connect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: _connect

 function _connect($HostOrInterface, $UserOrDSN = '', $argPassword = '', $argDatabase = '')
 {
     $this->_connectionID = @odbtp_connect($HostOrInterface, $UserOrDSN, $argPassword, $argDatabase);
     if ($this->_connectionID === false) {
         $this->_errorMsg = $this->ErrorMsg();
         return false;
     }
     $this->odbc_driver = @odbtp_get_attr(ODB_ATTR_DRIVER, $this->_connectionID);
     // Set driver specific attributes
     switch ($this->odbc_driver) {
         case ODB_DRIVER_MSSQL:
             $this->fmtDate = "'Y-m-d'";
             $this->fmtTimeStamp = "'Y-m-d h:i:sA'";
             $this->sysDate = 'convert(datetime,convert(char,GetDate(),102),102)';
             $this->sysTimeStamp = 'GetDate()';
             $this->ansiOuter = true;
             $this->leftOuter = '*=';
             $this->rightOuter = '=*';
             $this->hasTop = 'top';
             $this->hasInsertID = true;
             $this->hasTransactions = true;
             $this->_bindInputArray = true;
             $this->_canSelectDb = true;
             $this->substr = "substring";
             $this->length = 'len';
             $this->upperCase = 'upper';
             $this->identitySQL = 'select @@IDENTITY';
             $this->metaDatabasesSQL = "select name from master..sysdatabases where name <> 'master'";
             break;
         case ODB_DRIVER_JET:
             $this->fmtDate = "#Y-m-d#";
             $this->fmtTimeStamp = "#Y-m-d h:i:sA#";
             $this->sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
             $this->sysTimeStamp = 'NOW';
             $this->hasTop = 'top';
             $this->hasTransactions = false;
             $this->_canPrepareSP = true;
             // For MS Access only.
             // Can't rebind ODB_CHAR to ODB_WCHAR if row cache enabled.
             if ($this->_useUnicodeSQL) {
                 odbtp_use_row_cache($this->_connectionID, FALSE, 0);
             }
             break;
         case ODB_DRIVER_FOXPRO:
             $this->fmtDate = "{^Y-m-d}";
             $this->fmtTimeStamp = "{^Y-m-d, h:i:sA}";
             $this->sysDate = 'date()';
             $this->sysTimeStamp = 'datetime()';
             $this->ansiOuter = true;
             $this->hasTop = 'top';
             $this->hasTransactions = false;
             $this->replaceQuote = "'+chr(39)+'";
             $this->true = '.T.';
             $this->false = '.F.';
             $this->upperCase = 'upper';
             break;
         case ODB_DRIVER_ORACLE:
             $this->fmtDate = "'Y-m-d 00:00:00'";
             $this->fmtTimeStamp = "'Y-m-d h:i:sA'";
             $this->sysDate = 'TRUNC(SYSDATE)';
             $this->sysTimeStamp = 'SYSDATE';
             $this->hasTransactions = true;
             $this->_bindInputArray = true;
             $this->concat_operator = '||';
             break;
         case ODB_DRIVER_SYBASE:
             $this->fmtDate = "'Y-m-d'";
             $this->fmtTimeStamp = "'Y-m-d H:i:s'";
             $this->sysDate = 'GetDate()';
             $this->sysTimeStamp = 'GetDate()';
             $this->leftOuter = '*=';
             $this->rightOuter = '=*';
             $this->hasInsertID = true;
             $this->hasTransactions = true;
             $this->upperCase = 'upper';
             $this->identitySQL = 'select @@IDENTITY';
             break;
         default:
             if (@odbtp_get_attr(ODB_ATTR_TXNCAPABLE, $this->_connectionID)) {
                 $this->hasTransactions = true;
             } else {
                 $this->hasTransactions = false;
             }
     }
     @odbtp_set_attr(ODB_ATTR_FULLCOLINFO, TRUE, $this->_connectionID);
     if ($this->_useUnicodeSQL) {
         @odbtp_set_attr(ODB_ATTR_UNICODESQL, TRUE, $this->_connectionID);
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:facturaphp-svn,代码行数:90,代码来源:adodb-odbtp.inc.php


示例2: _connect

 function _connect($HostOrInterface, $UserOrDSN = '', $argPassword = '', $argDatabase = '')
 {
     $this->_connectionID = @odbtp_connect($HostOrInterface, $UserOrDSN, $argPassword, $argDatabase);
     if ($this->_connectionID === false) {
         $this->_errorMsg = $this->ErrorMsg();
         return false;
     }
     if ($this->_dontPoolDBC) {
         if (function_exists('odbtp_dont_pool_dbc')) {
             @odbtp_dont_pool_dbc($this->_connectionID);
         }
     } else {
         $this->_dontPoolDBC = true;
     }
     $this->odbc_driver = @odbtp_get_attr(ODB_ATTR_DRIVER, $this->_connectionID);
     $dbms = strtolower(@odbtp_get_attr(ODB_ATTR_DBMSNAME, $this->_connectionID));
     $this->odbc_name = $dbms;
     // Account for inconsistent DBMS names
     if ($this->odbc_driver == ODB_DRIVER_ORACLE) {
         $dbms = 'oracle';
     } else {
         if ($this->odbc_driver == ODB_DRIVER_SYBASE) {
             $dbms = 'sybase';
         }
     }
     // Set DBMS specific attributes
     switch ($dbms) {
         case 'microsoft sql server':
             $this->databaseType = 'odbtp_mssql';
             $this->fmtDate = "'Y-m-d'";
             $this->fmtTimeStamp = "'Y-m-d h:i:sA'";
             $this->sysDate = 'convert(datetime,convert(char,GetDate(),102),102)';
             $this->sysTimeStamp = 'GetDate()';
             $this->ansiOuter = true;
             $this->leftOuter = '*=';
             $this->rightOuter = '=*';
             $this->hasTop = 'top';
             $this->hasInsertID = true;
             $this->hasTransactions = true;
             $this->_bindInputArray = true;
             $this->_canSelectDb = true;
             $this->substr = "substring";
             $this->length = 'len';
             $this->identitySQL = 'select @@IDENTITY';
             $this->metaDatabasesSQL = "select name from master..sysdatabases where name <> 'master'";
             $this->_canPrepareSP = true;
             break;
         case 'access':
             $this->databaseType = 'odbtp_access';
             $this->fmtDate = "#Y-m-d#";
             $this->fmtTimeStamp = "#Y-m-d h:i:sA#";
             $this->sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
             $this->sysTimeStamp = 'NOW';
             $this->hasTop = 'top';
             $this->hasTransactions = false;
             $this->_canPrepareSP = true;
             // For MS Access only.
             break;
         case 'visual foxpro':
             $this->databaseType = 'odbtp_vfp';
             $this->fmtDate = "{^Y-m-d}";
             $this->fmtTimeStamp = "{^Y-m-d, h:i:sA}";
             $this->sysDate = 'date()';
             $this->sysTimeStamp = 'datetime()';
             $this->ansiOuter = true;
             $this->hasTop = 'top';
             $this->hasTransactions = false;
             $this->replaceQuote = "'+chr(39)+'";
             $this->true = '.T.';
             $this->false = '.F.';
             break;
         case 'oracle':
             $this->databaseType = 'odbtp_oci8';
             $this->fmtDate = "'Y-m-d 00:00:00'";
             $this->fmtTimeStamp = "'Y-m-d h:i:sA'";
             $this->sysDate = 'TRUNC(SYSDATE)';
             $this->sysTimeStamp = 'SYSDATE';
             $this->hasTransactions = true;
             $this->_bindInputArray = true;
             $this->concat_operator = '||';
             break;
         case 'sybase':
             $this->databaseType = 'odbtp_sybase';
             $this->fmtDate = "'Y-m-d'";
             $this->fmtTimeStamp = "'Y-m-d H:i:s'";
             $this->sysDate = 'GetDate()';
             $this->sysTimeStamp = 'GetDate()';
             $this->leftOuter = '*=';
             $this->rightOuter = '=*';
             $this->hasInsertID = true;
             $this->hasTransactions = true;
             $this->identitySQL = 'select @@IDENTITY';
             break;
         default:
             $this->databaseType = 'odbtp';
             if (@odbtp_get_attr(ODB_ATTR_TXNCAPABLE, $this->_connectionID)) {
                 $this->hasTransactions = true;
             } else {
                 $this->hasTransactions = false;
             }
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:101,代码来源:adodb-odbtp.inc.php


示例3: _connect

 function _connect($argHost, $argUsername = '', $argPassword = '', $argDSN = '', $persist = false)
 {
     if ($argUsername) {
         $argDSN .= ";uid={$argUsername}";
     }
     if ($argPassword) {
         $argDSN .= ";pwd={$argPassword}";
     }
     if ($persist) {
         $this->_connectionID = @odbtp_rconnect($argHost, $argDSN);
     } else {
         $this->_connectionID = @odbtp_connect($argHost, $argDSN);
     }
     if ($this->_connectionID === false) {
         $this->_errorMsg = $this->ErrorMsg();
         return false;
     }
     $this->odbc_driver = @odbtp_get_attr(ODB_ATTR_DRIVER, $this->_connectionID);
     //$this->oic_level = @odbtp_get_attr(ODB_ATTR_OICLEVEL, $this->_connectionID);
     $tc = @odbtp_get_attr('ODB_ATTR_TXNCAPABLE', $this->_connectionID);
     if ($tc == 0) {
         $this->hasTransactions = false;
     } else {
         $this->hasTransactions = true;
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:browsermin,代码行数:27,代码来源:adodb-odbtp.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP odbtp_execute函数代码示例发布时间:2022-05-15
下一篇:
PHP odbtp_commit函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap