Skip to content

Loading…

DBAL-239: CI 2 + DOCTRINE 2 + SQLSERVER 2005 PDO_SQLSRV.DLL #1414

Closed
doctrinebot opened this Issue · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user stcoid1:

Hi, master...

Please help me,
i was integration : ci2doctrine2pdo_mysql status is OK http://103.28.148.89/ci2doctrine2
php.ini http://103.28.148.89 ===> phpinfo()

But ci2doctrine2pdo_sqlsrv. Show bugs this :

"Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[IMSSP]: This extension requires either the Microsoft SQL Server 2008 Native Client (SP1 or later) or the Microsoft SQL Server 2008 R2 Native Client ODBC Driver to communicate with SQL Server. Neither of those ODBC Drivers are currently installed. Access the following URL to download the Microsoft SQL Server 2008 R2 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712' in C:\xampp\htdocs\sqlserver\application\thirdparty\doctrine-orm\Doctrine\DBAL\Driver\PDOConnection.php:36 Stack trace: #0 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Driver\PDOConnection.php(36): PDO->__construct('sqlsrv:server=B...', 'sa', 'password', Array) #1 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Driver\PDOSqlsrv\Driver.php(38): Doctrine\DBAL\Driver\PDOConnection->__construct('sqlsrv:server=B...', 'sa', 'password', Array) #2 C:\xampp\htdocs\sqlserver\application\third_party\doct in C:\xampp\htdocs\sqlserver\application\thirdparty\doctrine-orm\Doctrine\DBAL\Driver\PDOConnection.php on line 36"

Thanks
GBU

@doctrinebot

Comment created by stcoid1:

This Problem is resolve with SQL Server 2008.

But i have new problem, paging is Error

"Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]The multi-part identifier "c0.group_company_code" could not be bound.' in C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Connection.php:577 Stack trace: #0 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\DBAL\Connection.php(577): PDO->query('WITH outer_tbl ...') #1 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\ORM\Query\Exec\SingleSelectExecutor.php(46): Doctrine\DBAL\Connection->executeQuery('WITH outer_tbl ...', Array, Array) #2 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\ORM\Query.php(274): Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute(Object(Doctrine\DBAL\Connection), Array, Array) #3 C:\xampp\htdocs\sqlserver\application\third_party\doctrine-orm\Doctrine\ORM\AbstractQuery.php(539): Doctrine\ORM\Query->_doExecute() #4 C:\xampp\htdocs\sqlserver\application\third_party\doctri in C:\xampp\htdocs\sqlserver\application\thirdparty\doctrine-orm\Doctrine\DBAL\Connection.php on line 577"

This link http://103.28.148.89/sqlserver/index.php/company*group/posts/list_company*group

Any body help...

Thanks

@doctrinebot

Comment created by stcoid1:

Problem Resolve

go into:
Doctrine\DBAL\Platforms\MsSqlPlatform

Find:
$over = preg*replace('/\"[<sup>,]*\".\"([</sup>,]*)\"/i', '"inner*tbl"."$1"', $orderby);

Add before:

                    # Get Columns
                    $columns = array();
                    if(preg*match_all('/([a-zA-Z][0-9]<ins>_\.[a-zA-Z0-9\-_]</ins>)\sAS\s([a-zA-Z0-9\-\*]<ins>)/', $query, $matched)) {
                        for($i=0; $i<count($matched[1]); </ins><ins>$i)
                        {
                            $columns[$matched[1][$i]] = $matched[2][$i];
                        }
                    }

                    # Replace columns with their alias in the "orderby" statement
                    if(preg*match_all('/([a-zA-Z][0-9]</ins>_\.[a-zA-Z0-9\-*]+)\s/i', $orderby, $matches)) {
                        foreach($matches[1] as $column)
                        {
                            $orderby = preg_replace('/'.$column.'/', $columns[$column], $orderby);
                        }
                    }

Thanks on issue this link "http://www.doctrine-project.org/jira/browse/[DBAL-82](http://www.doctrine-project.org/jira/browse/DBAL-82)?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel"

@doctrinebot

Comment created by @beberlei:

CAn you post the query that leads to this error? I cant reproduce it with SQL Server 2008

@doctrinebot

Comment created by @beberlei:

This was fixed in other issues already

@doctrinebot

Issue was closed with resolution "Duplicate"

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.