Dear all,

How to connect SQL Database from Server 2005 through dyndns in php,

My dyndns address - xxx-xxx.dyndns.org
Port - 3389(default)

This is the code:

$dsn = 'DRIVER={SQL Server};SERVER=xxx-xxxx.dyndns.org:3389\SQLEXPRESS;DATABASE=XXXXXXX';
$connection = odbc_connect($dsn,'sa','xxxxxxx') or die('ODBC Error:: '.odbc_error().' :: '.odbc_errormsg().' :: '.$dsn);

Error Showing Like this:

Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection., SQL state 08001 in SQLConnect in C:\wamp\www\qamaruae\components\com_amc1234\views\amc1234\tmpl\statement.php on line 3
ODBC Error:: 08001 :: [Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection. :: DRIVER={SQL Server};SERVER=xxxx-xxxxx.dyndns.org:3389\SQLEXPRESS;DATABASE=xxxxxxxxxxx

Please help me.

ThanksπŸ™‚πŸ™‚

    Write a Reply...