MSDE cannot connect via telnet 1433 - query analyser works fine


MSDE installation with Entprise Manager and Query analyser from Eval copy.

DBs can be seen and edited on localhost.   Default port 1433 being used.  Query analyser works fine.

However asp application on host needs DSN-less access to SQL server via port.

I cannot even telnet into 1433 and see a response.

Yet there is no firewall and I know service is running?

Do you need to enable it somehow?  Maybe something odd with MSDE.

Any ideas?

Who is Participating?
davee_jayConnect With a Mentor Commented:
I imagine that due to the Dynamic Port allocation (a new 'feature' in SQL 2K) MSDE is not bound to the 1433 port.

You can check the version of the client libraries on the webserver as follows (W2K Prof - Your O/S may differ slightly):

Start -> Settings -> Control Panel -> Administrative Tools -> Data Sources (ODBC) -> Add

- Select the SQL Server Driver (Can you post the complete version number for our reference as well pls.) - Click Next

- Enter name, desc and Server - Click Next

- Client Configuration -> TCP/IP
  - Server name should be the name you entered
  - There should be a checkbox - Dynamically determine port - this should be checked - Click OK

- Click Next and Next again Then Finish

- Test Datasource

N.B. If there is no checkbox as noted above then install the SQL 2K client connectivity libraries on the webserver (not EM or QA though!)

Let me know how you get on.

arbertConnect With a Mentor Commented:
What do you get when you telnet--you don't normally get a response--you can type a few keystrokes and then you're taken back to a dos prompt....

Is the host on the same network--is it the host that you tried query analyzer from?  Is the asp application connecting using the same user/password you connected with from Query Analyzer?

Julian HansenConnect With a Mentor Commented:
Telnet won't return anything.

When you say Query Analyser works fine do you mean it works fine when you type in an IP address as opposed to the server name.

Does the script work when you use a server name instead of an IP?

When you use Query analyser - is it from the same machine as the asp script is running on?
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
>>I cannot even telnet into 1433 and see a response.
if you run telnet IP_ADDRESS:1433 and do not get a response AND NO ERROR, this is fine, because this means that the port is open.
if you get an error, then there is a firewall or the line is not available.
to explain: MSDE SQL Service actually get's the telnet connection, but doesn't answer to it. Thus TELNET client get's no response, but no error neither, as it actually waits from the TELNET server (which MSDE is not) to return/request some data. That's the way async communication works...

As described above:
* Check if the MSDE indeed uses port 1433
* Check the client configuration of the ASP host is configured correctly
* check also that the ASP has the permissions on the SQL Server to connect!!!

bendeckoAuthor Commented:
Thanks for all these great responses.

All the action is on one machine.  Website, MSDE, Query analyser all.....  No network or firewall or anything to worry about.

I know for a fact that if i telnet into my other machine (where all is working) I don't get refused entry on 1433 - this tells me that SQL is running fine.    I appreciate I get no response c.f. a mailserver response.

How can I determine which port SQL is running on if its dyanmic? Can I bind it manually.  What about a commandline command to see the binding services and ports?

I must have the connectivity libraries installed as EM and QA work - on the *same* machine.   No?

This is the ASP code that connects to the DB:

conn.Open "DRIVER=SQL Server;SERVER="&sysServer&";CATALOG="&sysCatalog&";UID="&sysUsername&";PWD="&sysPassword

No port is specficed in this string.  Does it need one?

Its worked hundreds of time on SQL servers running the full version of SQL Server 2000.  This is the first time I'm playing with MSDE and it doesn't appear to be playing the game the same way.

Thank you for your continued assistance.

Julian HansenCommented:
Goto your registry

check the following key


Under this Key either change the DSQUERY key to DBMSSOCN

Or create a server entry for your server

Create a new REG_SZ value with your server name as the value
Enter the following data for this value


Try again

If this fails then try the following

Create a new ODBC connection to your database. On the second screen click the client confiruation button and change the connection type to TCP/IP. Proceed through the setup and at the end test the conection by pressing the test connection button - tell us what happens.
Ah, okay the issue is clearer now.  You are right you must have the client libraries installed.

Please take a look at the SQL Server Network Utility and look at the enabled protocols.  I imagine TCP/IP is not in the list.  If this is the case, then it needs to be.  You can specify the default port here.

Let me know how you get on.

Also, can you post the driver version information (can be found as per my instructions above)

Agree--since QA is on the same machine you can probably connect fine.  Like davee_jay said above, did you enable protocols when you installed MSDE?
bendeckoAuthor Commented:
Yeah good work.

The protocol were enabled, yes.     Security all etc, all OK.

I read on another board to set the port to 0!  This turned out to be a disaster cos EM couldn't then see the DB at all.  This was supposed to let the server choose its own port.  Which, thinking about it, it did because...

I rebooted and it fixed itself and ent manager was able to connect.  I checked the port then in Client utility and it was 3144.   I changed this to 1433 and restarted the services and now we all cool.   Telnet in and ASP can access the DB.

I suspect that an additional reboot ealier would have actually had the same effect.

However EXCELLENT help and very quick responses.  Thank you.  I can now get back to serious business of coding the thing.



Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.