• <tfoot id='CaTZ9'></tfoot>
      <legend id='CaTZ9'><style id='CaTZ9'><dir id='CaTZ9'><q id='CaTZ9'></q></dir></style></legend>
      <i id='CaTZ9'><tr id='CaTZ9'><dt id='CaTZ9'><q id='CaTZ9'><span id='CaTZ9'><b id='CaTZ9'><form id='CaTZ9'><ins id='CaTZ9'></ins><ul id='CaTZ9'></ul><sub id='CaTZ9'></sub></form><legend id='CaTZ9'></legend><bdo id='CaTZ9'><pre id='CaTZ9'><center id='CaTZ9'></center></pre></bdo></b><th id='CaTZ9'></th></span></q></dt></tr></i><div id='CaTZ9'><tfoot id='CaTZ9'></tfoot><dl id='CaTZ9'><fieldset id='CaTZ9'></fieldset></dl></div>
        <bdo id='CaTZ9'></bdo><ul id='CaTZ9'></ul>

        <small id='CaTZ9'></small><noframes id='CaTZ9'>

        PHP PDO ODBC 连接

        时间:2023-10-05
      1. <i id='uOGCk'><tr id='uOGCk'><dt id='uOGCk'><q id='uOGCk'><span id='uOGCk'><b id='uOGCk'><form id='uOGCk'><ins id='uOGCk'></ins><ul id='uOGCk'></ul><sub id='uOGCk'></sub></form><legend id='uOGCk'></legend><bdo id='uOGCk'><pre id='uOGCk'><center id='uOGCk'></center></pre></bdo></b><th id='uOGCk'></th></span></q></dt></tr></i><div id='uOGCk'><tfoot id='uOGCk'></tfoot><dl id='uOGCk'><fieldset id='uOGCk'></fieldset></dl></div>
            <tbody id='uOGCk'></tbody>
          <legend id='uOGCk'><style id='uOGCk'><dir id='uOGCk'><q id='uOGCk'></q></dir></style></legend>

              <bdo id='uOGCk'></bdo><ul id='uOGCk'></ul>
            • <tfoot id='uOGCk'></tfoot>
                1. <small id='uOGCk'></small><noframes id='uOGCk'>

                2. 本文介绍了PHP PDO ODBC 连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我们正在尝试通过 PHP 中的 ODBC 创建与 SQL 数据库的连接.

                  we are trying to create a connection with our SQL database trough ODBC in PHP.

                  这是我们当前的脚本:

                  $cnx = new PDO("odbc:Driver={EFR};Server=localhost;Port:7004;Database=EFR;Uid=LcLfVJFLTKTCEHRO;Pwd=*********;"); 
                  

                  驱动程序在 Qlikview 中工作,该 Qlikview 也连接到此数据库.

                  The driver is working in Qlikview which also connects to this database.

                  驱动确实被PHP发现了,但我们认为它只是无法登录.

                  The driver is actually being found by PHP, but we think it just can't login.

                  PHP 返回以下错误:

                  PHP is returning the following error:

                  Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[IM001] SQLDriverConnect: 0 No transaction control system' in C:Program Files (x86)EasyPHP-12.1wwwindex.php:2
                  Stack trace:
                  #0 C:Program Files (x86)EasyPHP-12.1wwwindex.php(2): PDO->__construct('odbc:Driver={EF...')
                  #1 {main} thrown in C:Program Files (x86)EasyPHP-12.1wwwindex.php on line 2
                  

                  我们希望有人能帮助我们解决这个问题.

                  We hope someone can help us out with this problem.

                  推荐答案

                  如果您已经定义了 ODBC 并存储了密码,您只需使用

                  if you already have the ODBC defined and have a stored password, you can simply connect with

                  $conn = new PDO("odbc:DSN_NAME") 
                  

                  其中 DSN_NAME 是您的 ODBC 数据源的实际名称,无论是 MySQL、SQL Server 还是 DB2.

                  where DSN_NAME is the actual name of your ODBC datasource, be it MySQL, SQL Server or DB2.

                  您可以通过以下方式测试您的连接:

                  You can test your connection with the following:

                  try{
                      $conn = new PDO ("odbc:DSN_NAME");
                  
                      die(json_encode(array('outcome' => true)));
                  }
                  catch(PDOException $ex){
                       die(json_encode(array('outcome' => false, 'message' => 'Unable to connect')));
                  }
                  

                  这篇关于PHP PDO ODBC 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 PDO::FETCH_CLASS 和魔术方法 下一篇:PHP PDO MySQL 可滚动游标不起作用

                  相关文章

                  最新文章

                    <tfoot id='l9zfI'></tfoot>

                    • <bdo id='l9zfI'></bdo><ul id='l9zfI'></ul>

                    <i id='l9zfI'><tr id='l9zfI'><dt id='l9zfI'><q id='l9zfI'><span id='l9zfI'><b id='l9zfI'><form id='l9zfI'><ins id='l9zfI'></ins><ul id='l9zfI'></ul><sub id='l9zfI'></sub></form><legend id='l9zfI'></legend><bdo id='l9zfI'><pre id='l9zfI'><center id='l9zfI'></center></pre></bdo></b><th id='l9zfI'></th></span></q></dt></tr></i><div id='l9zfI'><tfoot id='l9zfI'></tfoot><dl id='l9zfI'><fieldset id='l9zfI'></fieldset></dl></div>
                    1. <small id='l9zfI'></small><noframes id='l9zfI'>

                      <legend id='l9zfI'><style id='l9zfI'><dir id='l9zfI'><q id='l9zfI'></q></dir></style></legend>