SQL server 2000 connection fails

T

tangokilo

Hi

I published the problem below some days earlier in
xxx.dotnet.languages.vb.data and got no response. So I try here, maybe
someone can help me!

When developing on stand alone PC using VB .net (Visual Studio 2003)
and SQL server 2000, the connection is established using
SqlConnection.ConnectionString="integrated security=sspi;server=tangokilo;
initial catalog=Forecasting;persist security info=false"

If same code runs on networked machine with SQL Server 2000 on network (we
also tried running this server on local machine), the same code fails.

Where lies the problem? Can someone help, please?

Regards
Thomas
 
W

William Ryan eMVP

What specific exception is being thrown?

Is this a named instance? If so, use WhatEverInstance\tangokilo for Data
Source. Also, stick with one connection
string style or the other... either of these should work.

Server=tangokilo;Database=Forecasting;Trusted_Connection=True;
Data Source=tangokilo;Initial Catalog=Forecasting;Integrated Security=SSPI;

My guess is that it's a named instance or it's the mixed connection string
style. If all else fails, try connecting
through Server Explorer in VS.NET and if it works, use the connection string
it creates modifying it where/if necessary
If not, verify that you have permissions to hit the server. I doubt it's
the problem but it is possible to log in on
an account, even if it's on the server, that can't get it.

HTH,

Bill
 
A

adamz5

1) ping the server see if you get a reponse (network Ok)
2)could be a security issue

Try catching the sql exception to see what message you get:

try
Catch sqlexc As SqlException
msgbox(sqlexc)
end try
 
T

tangokilo

Thanks Adam,

We tried various things on target machine. Found that
1) local server defined as 'VIPER' named as VIPER didn't, eg.
server=VIPER;..."
2) local server defined as (local) suddenly worked, eg. server=(local);..."
3) server of network named as 'NT_SQL1' worked too...

Some days later, after reassembling code on target machine, local server
using (local) worked too. What happened...????)

Regards
Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top