ASP/ Express 5/ Win 2003 connection problem

  • Hi

    I can’t seem to connect from a local or a remote web page via a connection string to an MS-SQL Express 5 db. I have a new install of Win 2003 and MS-SQL and I guess I must have missed somthing vital out.

    MS-SQL has been set up with a test db I'm trying to connect to.

    I have tried all the connection strings on connectionstrings.com + a load of others and still get the same can't connect error (both locally and remotely).

    Remote Connections has been set up to use both tcp /ip and named pipes.

    SQLExpress services and Sql Server browser services are both running.

    SQLServer is running - used cmd osql -L and it found SERVER\SQLEXPRESS ok.

    I have added SQLSERVR.EXE to firewall exceptions.

    I have added port 1433 as exception (checked ok via telnet from remote computer).

    Port 445 open as its included in print and file sharing (checked ok via telnet from remote computer).

    I can connect to SQLServer from a remote computer using management studio

    I can see asp webpages on sever from remote computer - iis is OK

    I can see "local host" asp pages Server - iis is OK

    From the MS-SQL log it looks like the server is listening for connections:

    - Server is listening on [ 'any' <ipv4> 1084].

    - Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\SQLEXPRESS ].

    - Server named pipe provider is ready to accept connection on [ \\.\pipe\MSSQL$SQLEXPRESS\sql\query ].

    I can't however connect to MS-SQL sever via a connection string on a web page

    Not sure if its relivant but I have also tried and I can’t seem to add an ODBC system dns (to SQL server) either using network log in or SQL authentication

    The error I get for both SQL and NT authentication is

    "Connection failed:

    SQLState: '01000'

    SQL Server error 10061

    [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen(()

    Connection failed

    SQLState:'08001'

    SQLServerError:17

    [Microsoft][ODBC SQL Server Driver [Named Pipes]SQLServer does not exist or access denied"

    In Local security settings, security options Network access: Named pipes that can be accessed anonymously( SQL\Query) is listed but not SQL Express.

    Do I need to add some sort of security policy/user to Win 2003 for SQLExpress so that network users can access the db via a webpage? If so, how do I go about this and can anyone point me in the direction of a good tutorial about how all this works please.

    Where am I going wrong? Any help gratefully received.

    Thanks

  • I believe that by default an installed instance does not listen to the default port of 1433.

    take a look at your configuration and see which ports it is currently listening to:

    in mt example, my installation was listening to 1711, and i could erase it and force it to listen to a specific port instead in the textbox below the current listening port.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks for help and appolagys for not replying sooner - For some reason I havent been able to log back onto this forum until today.

    Changing the tcp port certainly helped but still didnt get the web side of the connection working.... 3 reinstalls of the os and sql server just in case I had messed up a "setting", I found the problem...

    To make the con string work on the web page, the data source needs to be” . “ and not .\SQLExpress or localhost\ SQLExpress ect and you also need to use an ip address not the server name

    Eg for connecting a classic asp page to MS-SQL Express 5:

    Local = "Provider=SQLNCLI;Data Source =.;Initial Catalog=dbname;Uid=xxxx;Pwd=xxxx";

    Remote = "Provider=SQLNCLI;Data Source =xxx.xxx.xxx.xxx\.;Initial Catalog=dbname;Uid=xxxx;Pwd=xxxx";

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply