Home All Groups Group Topic Archive Search About

Connect using SQL Authentication in a non trusted environment

Author
22 Nov 2005 2:12 AM
LP
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.

Author
22 Nov 2005 3:53 AM
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?



Show quote
"LP" <L*@discussions.microsoft.com> wrote in message
news:12BCF4AA-D638-480A-B7A1-CB48253D114E@microsoft.com...
> 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.
Author
22 Nov 2005 11:53 AM
LP
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.


Show quote
"Rene" wrote:

> 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?
>
>
>
> "LP" <L*@discussions.microsoft.com> wrote in message
> news:12BCF4AA-D638-480A-B7A1-CB48253D114E@microsoft.com...
> > 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.
>
>
>
Author
22 Nov 2005 7:22 PM
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.
Author
22 Nov 2005 4:47 AM
luxspes
LP wrote:
> 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?

Show quote
>
> SQL Server is set for mixed mode.
>
> Any thoughts.
Author
22 Nov 2005 12:11 PM
LP
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,




Show quote
"luxspes" wrote:

> LP wrote:
> > 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?
>
> >
> > SQL Server is set for mixed mode.
> >
> > Any thoughts.
>
Author
22 Nov 2005 9:48 AM
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
Author
22 Nov 2005 12:12 PM
LP
Thanks I'll check that this morning

Show quote
"Cor Ligthert [MVP]" wrote:

> 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
>
>
>

AddThis Social Bookmark Button