Problem connect with SQL SERVER database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Santanu Basak
    New Member
    • Jul 2011
    • 1

    Problem connect with SQL SERVER database

    I am running a WinXP Pro w/ SP2 (my home computer)
    Apache 2.2.11
    MySQL 5.1.33
    PHP 5.2.9

    I have to connect a remote MSSQL database

    IIS
    MS SQL Sever 2005
    I am getting error
    Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'NT AUTHORITY\ANONY MOUS LOGON'. (severity 14)


    - I have ntwdblib.dll in my c:\apache2\bin &
    c:\php folders (year 2000 version)


    - I have extension=php_m ssql.dll in my php.ini

    - when I run:
    Code:
    <?php
    
    $host="mssql2.alpha.aussiehq.net.au";
    $user="user";
    $password="password";
    
    mssql_connect($host,$user,$password) or die ("could not connect to
    server"); // <-------- It always dies here. :(
    
    mssql_select_db("trtrades") or die ("could not connect to DB");
    
    ....
    
    
    ?>
    in php.ini file i set
    Code:
    mssql.allow_persistent = On
    mssql.max_persistent = -1
    mssql.max_links = -1
    mssql.min_error_severity = 10
    mssql.min_message_severity = 10
    mssql.compatability_mode = On
    ;mssql.connect_timeout = 5
    ;mssql.timeout = 60
    ;mssql.textlimit = 4096
    ;mssql.textsize = 4096
    ;mssql.batchsize = 0
    ;mssql.datetimeconvert = On
    mssql.secure_connection = Off
    mssql.max_procs = 25
    I know that the $host, $user, and $password are right because I can
    connect to the remote DB with the client tools.

    Please help me.
    Last edited by Niheel; Jul 27 '11, 10:21 PM.
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    It looks OK, although which ntwdblib.dll do you have?
    version 2000.2.8.0 does not work on server 2005.
    You need version 2000.80.194.0.

    Maybe it is your DNS, try the ip address rather than domain name 123.45.678.90

    Comment

    Working...