tel8618217223380 / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

Support PDO::sqlsrv to support MS SQL databas servers for PHP5.2+ #455

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Since PHP droppped PDO::mssql as of PHP 5.3 it is impossible to connect Prado 
to a MS SQL server. 

It seems that the PDO::sqlsrv implementation is a drop in replacement and I 
have used it in a simple project (using only CRUD commands on some simple 
tables with foreign keys).

It can be done with a very simple one line patch to the TDbMetaData class, 
attached is a patch against Prado 3.1.10.

The only thing to keep in mind is that this driver does not use the host and 
dbname parameters in the connection string, not much of a problem it uses 
server and database instead, so this:

    <database
      ConnectionString="mssql:host=hostname;dbname=database"
      username="username"
      password="password" />
    </module>

should be changed to this:

    <database
      ConnectionString="sqlsrv:server=hostname;database=database"
      username="username"
      password="password" />
    </module>

Original issue reported on code.google.com by jonathan...@gmail.com on 10 Apr 2013 at 6:20

Attachments:

GoogleCodeExporter commented 9 years ago
Committed as r3284, thank you!

Original comment by ctrlal...@gmail.com on 11 Apr 2013 at 7:15