Previous Next

Thread: ODBC Connection to SQL Server Fails - Perl, Fastcgi, IIS 6, Windows Server 2003, 64 bit

Last post 11-04-2007 1:22 PM by hreldelmyer. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 11-02-2007, 8:33 AM

    • hreldelmyer
    • Not Ranked
    • Joined on 11-02-2007, 8:22 AM
    • Posts 5
    • hreldelmyer

    ODBC Connection to SQL Server Fails - Perl, Fastcgi, IIS 6, Windows Server 2003, 64 bit

    My Perl program connects to SQL SERVER via ODBC without any trouble  from the comand line and straight CGI, but it fails with the latest fastcgi downloads:

    DBI connect('XXX5_client_user1','XXX',...) failed: [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error. Check your network documentation. (SQL-08001)
    [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen (Connect()). (SQL-01000)(DBD: db_login/SQLConnect err=-1) at D:/User/XXX5_client/lib/DB/DBI.pm line 156

     

    I assume that it is some sort of permissions problem. Is fastcgi running as the user specified in the identity of the worker process? If not, where can the user id be changed?

     

    Note that tests of my program without attempting database connections work fine. 

     

    Does windows server / IIS require that additional permissions be given to the account that is running the script?
     

    Any help would be appreciated.

    Thanks

    Horace 

    Thanks for any help
    Horace
  • 11-02-2007, 11:35 AM In reply to

    • rickjames
    • Top 25 Contributor
    • Joined on 10-31-2006, 6:43 PM
    • Posts 193
    • rickjames

    Re: ODBC Connection to SQL Server Fails - Perl, Fastcgi, IIS 6, Windows Server 2003, 64 bit

    Hi Horace,

    FastCGIs are spawned with the same identity as the worker process. FastCGIs, using named pipes, can be configured to impersonate the authenticated user. e.g. in php.ini set fastcgi.impersonate=1. Please let us know if this does not work.

    Thanks,

    Rick.

  • 11-02-2007, 10:33 PM In reply to

    • hreldelmyer
    • Not Ranked
    • Joined on 11-02-2007, 8:22 AM
    • Posts 5
    • hreldelmyer

    Re: ODBC Connection to SQL Server Fails - Perl, Fastcgi, IIS 6, Windows Server 2003, 64 bit

     It turns out that the problem is probably due to the 64 bit DBD::ODBC. I had no trouble with the ODBC connection with the same system installed on a windows server 2003 32 bit.

    A new problem is that fastcgi (32 bit) is losing the Set-Cookie headers so my session cookies are not working. Does anyone know what is happening there?

    Thanks for any help
    Horace
  • 11-03-2007, 9:19 PM In reply to

    • rickjames
    • Top 25 Contributor
    • Joined on 10-31-2006, 6:43 PM
    • Posts 193
    • rickjames

    Re: ODBC Connection to SQL Server Fails - Perl, Fastcgi, IIS 6, Windows Server 2003, 64 bit

    Hi hreldelmyer,

    You may find reading about microsoft.com's transition to x64 interesting: http://technet.microsoft.com/en-us/library/bb735208.aspx

    There was a multiple Set-Cookie bug in older versions of our FastCGI. Could you try using the latest bits and see if you still have troubles: http://forums.iis.net/t/1146797.aspx

    Thanks,

    Rick.

  • 11-04-2007, 1:22 PM In reply to

    • hreldelmyer
    • Not Ranked
    • Joined on 11-02-2007, 8:22 AM
    • Posts 5
    • hreldelmyer

    Re: ODBC Connection to SQL Server Fails - Perl, Fastcgi, IIS 6, Windows Server 2003, 64 bit

     Thanks every one for your help. My application now works correctly under FCGI on the windows server 2003 32 bit box. However, I am still getting this network error under windows server 2003 64 bits ...

    I can run the Perl code from a DOS prompt. The identity for my IIS worker process is the same user as the one that I used testing from the DOS prompt. The application works fine as a CGI application. Is there some special permission setting that the worker process account needs that the CGI account does not need?


    DBI connect('XXX5_client_user1','XXX',...) failed: [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error. Check your network documentation. (SQL-08001)
    [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen (Connect()). (SQL-01000)(DBD: db_login/SQLConnect err=-1) at D:/User/XXX5_client/lib/DB/DBI.pm line 156

    If I switch the ODBC configuration to use SQL SERVER Native client rather than SQL SERVER, the error is somewhat different ... it complains that the server is not found.

    Thanks again

    Thanks for any help
    Horace
Page 1 of 1 (5 items)
Page view counter