gdufo

           

          通達OA 連接SQL-Server2005

            參考:http://www.cnblogs.com/xiaochaohuashengmi/archive/2011/07/29/2121347.html
                http://www.soitway.com/woaibiancheng/19.html
            記得重啟一下office_anywhere
            另:mssql.secure_connection = Off 要設置為 off
            在td_config.php(webroot\inc目錄下)增加變量。
            //-- OT 數據庫配置
            $MSSQL_OT_SERVER="192.168.1.1";
            $MSSQL_OT_USER="sa";
            $MSSQL_OT_DB="DBName";
            $MSSQL_OT_PASS="XXXX";

          function OpenOTConnection()
          {
           global $otconnection,$MSSQL_OT_SERVER,$MSSQL_OT_USER,$MSSQL_OT_DB,$MSSQL_OT_PASS;
           if(!$otconnection)
           {
             if(!function_exists("mssql_pconnect"))
              {
                 echo "PHP配置有誤,不能調用Mssql函數庫,請檢查有關配置";
                 exit;
              }
              $C=@mssql_pconnect($MSSQL_OT_SERVER,$MSSQL_OT_USER,$MSSQL_OT_PASS);
          //$C=@mssql_connect($MSSQL_OT_SERVER,$MSSQL_OT_USER,$MSSQL_OT_PASS);
           }
           else
              $C=$otconnection;
           $result=mssql_select_db($MSSQL_OT_DB,$C);
           if(!$result)
           {
              PrintError("數據庫 ".$MSSQL_OT_DB."不存在");
              //exit;
           }
           return $C;
          }
          function exemsqlquery($C,$Q)
          {
           $cursor = mssql_query($Q,$C);
           if(!$cursor)
           {
              PrintError("<b>SQL語句:</b> ".$Q);
              //exit;
           }
           return $cursor;
          }

          posted on 2013-03-06 11:04 gdufo 閱讀(609) 評論(0)  編輯  收藏 所屬分類: OA(Moss+Infopath)

          導航

          統計

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          收藏夾

          Hibernate

          友情鏈接

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 巨鹿县| 密山市| 无棣县| 会昌县| 东平县| 江油市| 泰安市| 安国市| 仙居县| 和田县| 修水县| 长顺县| 山东| 福州市| 琼中| 鄂尔多斯市| 安吉县| 姚安县| 潞西市| 贵港市| 贵德县| 徐州市| 漳平市| 航空| 关岭| 吴堡县| 冷水江市| 醴陵市| 德化县| 东阳市| 临西县| 商洛市| 安乡县| 凌海市| 弥渡县| 海安县| 枝江市| 杭锦旗| 湖南省| 嘉义县| 乌拉特中旗|