Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 TCP Provider: No host is known

Author  Topic 

rand4505
Starting Member

7 Posts

Posted - 2011-11-11 : 11:05:40
I am trying to connect my application,VC++ 2010 CLR on a Vista box, to an MSSQL 2005 instance on a WIN NT 2k server and I am getting errors that dont make any sense. I have tried both the hostname and IP in the connection string, I am forcing a tcp connection to the server, TCP is enabled on the server. Remote Connections are allowed, mixed mode authentication is enabled. SQL Server Browser is running on the server but the port 1434 it not listening, I am stumped on that one, port 1433 is open and I can connect to the server with the management program on that port with the login I am using. I have 2 alise's setup that both redirect to the actual IP\Instance of the server, and I verified them in the registry as well. I created the connection string by making a file, test.udl, running the wizard and then tweaking the connection syntax, tested successfully in the wizard.

Connstring
-----------
Driver={SQL Native Client};Provider=SQLNCLI;Password=******;Integrated Security=false;Persist Security Info=True;User ID=*******;Initial Catalog=DBase;Server=tcp:*******\\INSTANCE
-----------
Error string
-----------
SQLSTATE: 08001
Message: [Microsoft][SQL Native Client][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
SQLSTATE: 28000
-----------
Constring
-----------
Driver={SQL Native Client};Provider=SQLNCLI;Password=*******;Integrated Security=false;Persist Security Info=True;User ID=********;Initial Catalog=DBase;Server=tcp:*******\INSTANCE
-----------
Error
-----------
Message: [Microsoft][SQL Native Client]TCP Provider: No such host is known.
SQLSTATE: 08001

Any help is apreciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-11-11 : 11:17:45
The first error is good. That connection string is working, it's just a login issue.

Is your system installed with mixed-mode authentication? The default is Windows only. I see you are trying to connect with SQL auth though per the userid/password combo. Seems you just need to enabled mixed-mode.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

rand4505
Starting Member

7 Posts

Posted - 2011-11-11 : 11:22:51
The thing is that mixed mode is enabled. I use SQL Auth to login remotely.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-11-11 : 11:37:11
I would run a trace then using SQL Profiler. Add the login failed event and see what userid your system is sending.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

rand4505
Starting Member

7 Posts

Posted - 2011-11-11 : 11:59:53
SQL Profiler: Failed to start a new trace.

Checked the enviroment varibles temp dirs, they exist and are empty.

Pointed them to a new location and same error.
Go to Top of Page

rand4505
Starting Member

7 Posts

Posted - 2011-11-11 : 12:57:29
Same error for all the accounts on the server.

The default trace is running and logging, tried to open it and recieved error, Failed to open file. Same error when trying to open previous traces.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-11-11 : 13:09:07
Here you go: http://blogs.msdn.com/b/sql_protocols/archive/2008/05/03/understanding-the-error-message-login-failed-for-user-the-user-is-not-associated-with-a-trusted-sql-server-connection.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

rand4505
Starting Member

7 Posts

Posted - 2011-11-12 : 09:57:20
Well that might be have the solution but our network does not have a domain server, all static IP's on our network, everyone is in the same workgroup and all stored credentials have been removed.
Go to Top of Page

vikki.seth
Yak Posting Veteran

66 Posts

Posted - 2011-11-12 : 16:10:37
In a workgroup, you'll hv to use SQL Authentication while connecting to a remote server. Try creating an odbc connection from control panel and test connectivity.
Go to Top of Page

rand4505
Starting Member

7 Posts

Posted - 2011-11-14 : 07:47:11
Already did that, that is how I connect to the server via the management software and excel.
Go to Top of Page

rand4505
Starting Member

7 Posts

Posted - 2011-11-14 : 09:30:30
Seems that the SQL Server Browser is on 1433 and not 1434.

2011-11-10 13:12:35.66 Server Server is listening on [ 'any' <ipv4> 4315].

I redirected my program to connect to 4315, and am able to connect but with this error. I think I can handel it from this point forward. I am curious as to why the SQL Server Browser is not redirecting the driver to connect on port 4315 but I will have to diagnose that later.

Success with info.
Message: [Microsoft][ODBC SQL Server Driver][SQL Server]Changed database context to 'master'.
SQLSTATE: 01000
Go to Top of Page
   

- Advertisement -