Re: PHP, PDO dsn-less connection to MS-SQL 2008

Andreas <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Am 11.12.2011 15:37, schrieb Cesare Leonardi:
> On 11/12/2011 08:14, Andreas wrote:
>> can someone help me with PHP, PDO dsn-less connection to MS-SQL 2008,
>> please?
> This is the connection string i'm currently using to connect to MSSQL
> 2000 with FreeTDS 0.91 and without any external conf file:
>
> $dbDriver = "FreeTDS; TDS_Version=7.1; port=1433";
> $dbh = new PDO("odbc:Driver=$dbDriver; Server=$serverFQDN;
> Database=$dbName; Uid=$usr; Pwd=$pwd;");
>
This didn't work either at first but then I've got it working like this:
$drv = "SQL Server; TDS_Version=8.2; Port=1433";
$dbh = new PDO( "odbc:Driver=$drv; Server=192.168.0.123; Database=xx; 
UID=yy; PWD=zz;" );

I tried "FreeTDS" as drivername earlier but it wouldn't work. Only now I 
figured out that OpenSuse registers the FreeTDS driver as "SQL Server".

Btw. is there a reason that ODBCConfig only offers TDS versions up to 
7.0? AFAIK 8.0 is MSSQL 2005 so it's not really that new.


Thanks   :)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.