Connect using SQL Authentication in a non trusted environment

G

Guest

Hello all,

I need to connect to a SQL 2000 from a .net app using SQL Authentication.
My connection string looks like this:
Dim conn As New SQLConnection
conn.ConnectionString = "user id = validuser; password = validpassword;
Trusted_Connection=False; Intial Catalog=pubs; Data Source =
10.24.4.126,1433;Network Library=DBMSSOCN"

This connection string works when I use a internal IP to connect to a
internal SQL server but not when I need to connect to the outside world.

SQL Server is set for mixed mode.

Any thoughts.
 
R

Rene

First things first, did you try pinging the server you are trying to
connect?



Second, is your SQL server configured to talk to the outside world? Enabled
Protocols Named Pipes, TCP/IP etc?
 
L

luxspes

LP said:
Hello all,

I need to connect to a SQL 2000 from a .net app using SQL Authentication.
My connection string looks like this:
Dim conn As New SQLConnection
conn.ConnectionString = "user id = validuser; password = validpassword;
Trusted_Connection=False; Intial Catalog=pubs; Data Source =
10.24.4.126,1433;Network Library=DBMSSOCN"

This connection string works when I use a internal IP to connect to a
internal SQL server but not when I need to connect to the outside world.
Hi!
What do you mean by "connect to the outside world." does it mean that
you want to connect to you sqlserver from outside you network? are you
sure that the firewall (or router) between you outside computer and you
inside server allow traffic to the 1433 to your inside SQLServer?
 
C

Cor Ligthert [MVP]

LP,

The 10.xxx.xxx.xxx range of the IP addresses is typical (as partial some
others) meant to be used inside an internal organisation. It is not known in
the Internet DNS.

To get this for the outside world, you need from your system administrator
an outside world DNS for the server where this database is running on (and
should be enclosed on your firewall).

I hope this helps,

Cor
 
G

Guest

Hi Rene,

Thanks for getting back with me. Yes I can ping the server. Yes the tcp/ip
is configured and the port is open for traffic.


BTW the error I get is that the connection is not trusted.
 
G

Guest

Hi,

Thanks for getting back with me. Yes connecting to the SQL server outside
my network. I know both servers will connect but I'll need the network admin
to check the firewall.

BTW the error I get is that the connection is not trusted.

Thanks,
 
R

Rene

BTW the error I get is that the connection is not trusted.

Interesting, I have gotten this error before but this was because the SQL
server was configured to work only on a trusted environment but this does
not seem to be your case since you have it as mix mode.

Try connecting to the server using the Query Analyzer rather than doing it
by code, sometimes the Query Analyzer will give you a more descriptive error
and it also takes cares about all of those nasty connection parameters.

If you are able to connect with the Query Analyzer then it means that
something is wrong with your connection string. If you can't connect with
Query Analyzer then something is probably wrong with your
Server/Client/Firewall/etc configuration.
 

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