MS SQL connection string for remote internet connection? 
Author Message
 MS SQL connection string for remote internet connection?

Hi!

I have my MS SQL 2000 server installed and working. On the server itself I
can connect with my username/password and access data as necessary. When I
try to connect from a remote connection over the internet (Using a VB6
program) I am having no luck at all.

The connection string that I'm using is:
  Provider=SQLOLEDB.1;User ID=username;Password=password;Initial
Catalog=database;Data Source=68.145.45.32

This does not connect. I've tried including ",1433" after the IP as well as
adding the SQL server name after the IP (such as Data
Source=68.145.45.32/SERVER).

I'm also going through a router, which has port 1433 and 1434 forwarding to
my server PC without issue (it works for my other ports/services) (I've
tried TCP forwarding and UDP forwarding, which should I use?)

Can someone suggest what I might be doing wrong? Here is a sample of the VB6
code that I'm using...

  Dim strConnect as string
  Dim cnn As ADODB.Connection
  Set cnn = New ADODB.Connection

  strConnect = "Provider=SQLOLEDB.1" _
      & ";User ID=username" _
      & ";Password=password" _
      & ";Initial Catalog=database" _
      & ";Data Source=68.145.45.32"

   cnn.Open sConn

Can anyone suggest how I should be connecting to my remote server?

Thanks!



Tue, 04 Oct 2005 17:03:25 GMT  
 MS SQL connection string for remote internet connection?
Hi

I am no expert on this but ... all routers/firewalls between the client and
server will require the ports to be available.

John


Quote:
> Hi!

> I have my MS SQL 2000 server installed and working. On the server itself I
> can connect with my username/password and access data as necessary. When I
> try to connect from a remote connection over the internet (Using a VB6
> program) I am having no luck at all.

> The connection string that I'm using is:
>   Provider=SQLOLEDB.1;User ID=username;Password=password;Initial
> Catalog=database;Data Source=68.145.45.32

> This does not connect. I've tried including ",1433" after the IP as well
as
> adding the SQL server name after the IP (such as Data
> Source=68.145.45.32/SERVER).

> I'm also going through a router, which has port 1433 and 1434 forwarding
to
> my server PC without issue (it works for my other ports/services) (I've
> tried TCP forwarding and UDP forwarding, which should I use?)

> Can someone suggest what I might be doing wrong? Here is a sample of the
VB6
> code that I'm using...

>   Dim strConnect as string
>   Dim cnn As ADODB.Connection
>   Set cnn = New ADODB.Connection

>   strConnect = "Provider=SQLOLEDB.1" _
>       & ";User ID=username" _
>       & ";Password=password" _
>       & ";Initial Catalog=database" _
>       & ";Data Source=68.145.45.32"

>    cnn.Open sConn

> Can anyone suggest how I should be connecting to my remote server?

> Thanks!



Tue, 04 Oct 2005 17:33:32 GMT  
 MS SQL connection string for remote internet connection?

Quote:

> Hi!

> I have my MS SQL 2000 server installed and working. On the server
> itself I can connect with my username/password and access data as
> necessary. When I try to connect from a remote connection over the
> internet (Using a VB6 program) I am having no luck at all.

> The connection string that I'm using is:
>   Provider=SQLOLEDB.1;User ID=username;Password=password;Initial
> Catalog=database;Data Source=68.145.45.32

> This does not connect. I've tried including ",1433" after the IP as
> well as adding the SQL server name after the IP (such as Data
> Source=68.145.45.32/SERVER).

<snip>

You need to force the use of the TCP/IP network library:

strConnect  = "Provider=SQLOLEDB" & _
   ";Network Library=DBMSSOCN" & _
   ";Data Source=68.145.45.32,1433" & _
   ";Initial Catalog=MyDatabase" & _
   ";User ID=MyUsername" & _
   ";Password=MyPassword"

HTH



Tue, 04 Oct 2005 20:56:10 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Remote Connection Wizard - connection to MS Exchange

2. DSN-less connection string to a remote MS Acess database

3. Need Connection string for VB6 DAO DSN-LESS Connections to SQL Server 2000

4. Need Connection string for VB6 DAO DSN-LESS Connections to SQL Server 2000

5. remote connection to internet

6. !!!!! HELP - Remote ms-access database connection with vb6 !!!

7. connection string to Remote ACCESS Database in ADO

8. Connection string for DSN-less Informix connection

9. Connection String vs. Connection Object

10. Connection: changing connection string in data environment

11. Connection Obj vs. Connection String

12. diff between active connection & connection string help

 

 
Powered by phpBB® Forum Software