Cannot connect to local SQLServer2000 database

  • Thread starter Thread starter Paul Robinson
  • Start date Start date
P

Paul Robinson

Hi,

I am having problems connecting to a local SQLServer2000 database using
ADO.NET. I am using a 3rd party assembly which I have no control over, and
the database connection string is hardcoded into the application (nice).
The connection string looks like this:

"UID=john;password=johnspassword;Initial Catalog=thedb;Data Source=local"

I do have the database setup on the local machine, but when trying to
connect I get the error:

"SQL Server does not exist or access is denied"

Now, I have tried to connect to the database using Query Analyser and it
will not connect to a server called "local" but it WILL connect to a server
called "(local)".

Because I can't change the connection string I need to get it connected
using "local". It works on one machine but not the test machine I have. As
far as I can tell everything is set up the same.

I have tried setting up various aliases for "local" using the SQL Server
Client Network Utility, but still having no success. I have set up a named
pipe and also a TCP/IP alias for "local" but I still can't get the
connection to work.

Can anyone help with this?

Thanks!
 
You should call the support line for the 3rd party product. They either need
to walk you through it, or they need to realize that it is ludicrous to hard
code a connection string anywhere, and change their component. Or better
yet, find a way to not have to use their product so you don't have to waste
your time dealing with things you shouldn't have to be.
 
Paul,

Did you try to change the machinename and than the server name to "local"

Just a try

Cor
 
Or maybe creating an alias with the name « local » (using the Network
Client Utility of SQL-Server 2000, not sure of the translation of the name
here) ?

The real shortcut for the local machine is (local) and not local; so maybe
creating an alias will do the trick.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
 
Thanks for the replies. I tried creating aliases (both a TCP/IP one and
also a named pipe one) but that didn't help.
 
Hum, just to be sure: the connection string is really:

"UID=john;password=johnspassword;Initial Catalog=thedb;Data Source=local"

and not:

"UID=john;password=johnspassword;Initial Catalog=thedb;Data Source=(local)"
?

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
 
Back
Top