#1572: Connecting with to SQL server with ODBC
-----------------------------------+----------------------------------------
Reporter: jphilip | Owner: jwage
Type: defect | Status: new
Priority: major | Milestone: 1.0.4
Component: Connection | Version: 1.0.3
Keywords: | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 1
-----------------------------------+----------------------------------------
The DB-Library that the current MSSQL adapter uses has a lot of problems
and is not going to be supported in future versions of MSSQL.
The PHP web site recommends using ODBC to connect to MSSQL, but I was not
able to do it in Doctrine as it seems that the ODBC driver is not
associated with a Doctrine_Connection implementation.
I was able to connect with ODBC by associating ODBC with
Doctrine_Connection_Mssql in the Manager openConnection method. (See
patch)
I also have to first create a PDO object and then pass it to Doctrine as
ODBC allows passing a dsn without hostname and Doctrine does not.
The following code works, but only with the joined patch as a quick fix:
$dbh = new PDO("odbc:localexpress");
$conn = Doctrine_Manager::getInstance()->connection($dbh, "db_import");
$conn ->setOption ('dsn', "odbc:localexpress");
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1572>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---