• PHP Help PHP Coding
  • How to Connect SQL database from SQL Server 2005 through dyndns.org in php.. Pls Help

Hai all,

I tried so many codes, in my local server its works when i am using SERVER/SQLEXPRESS, when i am hosted my website, error showing, at finally i concluded that its not possible in this way, i used dyndns.org. every time showing error like
odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in

Please help every body...

Sincerely
Vigin Kurakar

    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=xxxxx-xxxxx.dyndns.org:3389\SQLEXPRESS;DATABASE=XXXXXXXX';
    $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.🙂🙂🙂🙂

      Merged your two threads together.

        Network issues aren't necessarily within the purview of PHPBuilder.

        I'd suggest the following points of inquiry.

        1. Make sure the name resolves from the client machine.
        2. Draw us a picture ... I assuming we're going over the WAN.
        3. Do you control both machines? I'd suspect firewalls.
        4. Make sure the server is listening on its outside interface.
          dalecosp;10968746 wrote:

          Network issues aren't necessarily within the purview of PHPBuilder.

          I'd suggest the following points of inquiry.

          1. Make sure the name resolves from the client machine.
          2. Draw us a picture ... I assuming we're going over the WAN.
          3. Do you control both machines? I'd suspect firewalls.
          4. Make sure the server is listening on its outside interface.

          Using my dyndns address i can login to server from anywhere.

          My doubt is in my server there is no php_mssql dll's , so any problem with that?

            kurakar;10968765 wrote:

            My doubt is in my server there is no php_mssql dll's , so any problem with that?

            I doubt it, since you aren't using the mssql extension at all.

            EDIT: By the way, are you positive about the DB port number? TCP port 3389 is usually reserved for Microsoft Terminal Server (RDP) daemon.

              bradgrafelman;10968766 wrote:

              I doubt it, since you aren't using the mssql extension at all.

              EDIT: By the way, are you positive about the DB port number? TCP port 3389 is usually reserved for Microsoft Terminal Server (RDP) daemon.

              i configured port no. 3389 in linksys router for mydyndns.org. DB port no. is default, i think it is starting from 1433.

                Can you use netstat on the server and see if it is listening, and, if so, on what port? Can't remember exactly which switches work on Windows ... I'd use netstat -anf inet | grep 1433 on 'Nix ... maybe netstat -an | find "1433" on your Windows server?

                  Write a Reply...