[freetds] Connect to Sybase ASA 8 with pear:DB

James K. Lowden jklowden at schemamania.org
Fri Jun 11 17:39:20 EDT 2004


On Thu, 10 Jun 2004, "Florian Kornhoffer" <f.kornhoffer at laufwerk.de>
wrote:
> 
> I'm not very successfull in connecting to our Sybase DB from our 
> Webserver.
...
> require_once "DB.php";
> 
> $dsn = array(
>     'phptype'  => 'sybase',
>     'username' => 'dba',
>     'password' => 'xx',
>     'hostspec' => '62.153.x.x',
>     'port'     => '2638',
>     'database' => 'testdb',
> );
> 
> $db =& DB::connect($dsn);
> if (DB::isError($db)) {
>     die($db->getMessage());
> }

You have an ASA server.  I don't use PHP, but it looks like you're using
the sybase extension.  Your server needs an entry in freetds.conf, and the
name of that entry must be the ASA database you want to connect to
('testdb').  I guess your 'hostspec' entry, above, would be that name, not
the server's IP address.  

HTH.

--jkl



More information about the FreeTDS mailing list