Connection failure: SqlServer does not exist or access denied.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am connecting to a SqlServer database on my machine using a SqlConnection. It works fine.
I have tried it on several machines, and there is one machine where it doesn't work and the exception says:
SqlServer does not exist or access denied. I changed the connection string to use the IP instead of the server name and the connection worked. I think that the Server name couldn't be resolved to an IP address (maybe because that system has more than one IP), and hence returned an error. Is this hypothesis on the right track? I need to know what the cause of the problem is so that I can work around it accordingly...
Cheers,
James Chang
 
hi,
check out each and every word of connection string ...
may be that machine requires case sensitive ...
the server name
if uid is there then it must be user id etc..



--
Thanks and Regards,

Amit Agarwal
Software Programmer(.NET)
James Chang said:
Hello,
I am connecting to a SqlServer database on my machine using a SqlConnection. It works fine.
I have tried it on several machines, and there is one machine where it
doesn't work and the exception says:
SqlServer does not exist or access denied. I changed the connection string
to use the IP instead of the server name and the connection worked. I think
that the Server name couldn't be resolved to an IP address (maybe because
that system has more than one IP), and hence returned an error. Is this
hypothesis on the right track? I need to know what the cause of the problem
is so that I can work around it accordingly...
 
Try using the ping command and see if you get a response:

ping <servername>

Is the machine on the same domain or on a trusted domain?

James Chang said:
Hello,
I am connecting to a SqlServer database on my machine using a SqlConnection. It works fine.
I have tried it on several machines, and there is one machine where it doesn't work and the exception says:
SqlServer does not exist or access denied. I changed the connection
string to use the IP instead of the server name and the connection
worked. I think that the Server name couldn't be resolved to an IP
address (maybe because that system has more than one IP), and hence
returned an error. Is this hypothesis on the right track? I need to
know what the cause of the problem is so that I can work around it
accordingly...
 
Are you using Integrated security or SQL authentication? If you're
suppliying a username/pass in your connectionstring make sure SQL
authentication is enabled on that server. If not you will receive this
error.

Eric

James Chang said:
Hello,
I am connecting to a SqlServer database on my machine using a SqlConnection. It works fine.
I have tried it on several machines, and there is one machine where it
doesn't work and the exception says:
SqlServer does not exist or access denied. I changed the connection string
to use the IP instead of the server name and the connection worked. I think
that the Server name couldn't be resolved to an IP address (maybe because
that system has more than one IP), and hence returned an error. Is this
hypothesis on the right track? I need to know what the cause of the problem
is so that I can work around it accordingly...
 
Back
Top