Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSSQL 2000 connection Error

Status
Not open for further replies.

trmoney

Programmer
May 2, 2001
15
US
I am trying to connect to MSSQL 2000 , using JDBC driver. MSSQL installed on my local computer and in connection string I am using localhost for a server name and port 1433. I have problems to connect to debase and receive an error message "Connection refuse". Can someone to help me to resolve this problem

Thanks
 
Checkout this thread, and let me know if you are still having issues.

thread269-596620
 
I already tried all these steps and still no luck. I suspect that SQL has a different TCP/IP address than a localhost (127.0.0.1). Is it any way programmatically check a MSSQL Server TCP/IP address.

Thanks
 
Both my Java Web application and MSSQL Database sitting on my computer. Do I have to telnet in this case?

thanks
 
Ok, could you try the following, and let us know your results.

1. Open notepad (or any another app. like that).
2. Create a empty file and save it. Call it whatever you want, however the file ext should be .udl.
3. Double Click on the .udl file you created.
4. This will open up a form, on the form click on the radio button called "Use Connection String", then click on Build...
5. Then choose the Data source, or create a new one if you did not do this already.
6. Once you get the data Source, click ok. It will now ask you for a user name and password, supply that to the program.
7. Once you click OK...it will bring you back to the orginal form...Notice that you now have text for Connection String... Now Click the button label Test connection, if everything is ok, you now know that you can connect to SQL Server.

The string in the textBox label Connection String is what this program used to connect, so it has all the correct values.

The String looks something like this:

DSN=<SomeDNS>;UID=<User ID>;PWD=<Password>;APP=Microsoft(R) Windows (R) 2000 Operating System;WSID=<Windows User ID>;DATABASE=<The Name of the DB>;Network=<Not sure what this is>;Address=<The IP address, Followed by the Port>

Take the value and compare them to the value in your app, and make sure the match.

Please let us know what happens.
 
Thank you JVZ for advice. I did everithing you said and Connection String looks like this:

&quot;DSN=test;UID=sa;PWD=password;APP=????????????????????;WSID=OEMCOMPUTER;DATABASE=master;Network=DBMSSOCN&quot;. It is no ADDRESS at the end of String.

When I pressed Test Connection button I got message &quot;Connection succeeded.&quot;

System I have on my computer is Windows 98 and TCI/IP properties are set up to &quot;Obtain IP address automatically&quot;

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top