Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: database connection


Message #1 by "Ian Jowett" <virtuian@y...> on Wed, 6 Mar 2002 16:38:59 -0000
--=====================_24116127==_.ALT
Content-Type: text/plain; charset="us-ascii"

I have just written a program that will do exsactly that. My VB program is using the DataEnvironment but I'm assuming you could also
use a connection. This is the code I use. It allows connection through either the server DSN name or the IP address:

        If InStr(1, Start.IPAddress, ".") > 0 Then
        '   IP Address
            NTAuthentication.SQLMailing.ConnectionString = "Provider=sqloledb;" & _
            "Data Source=" + Start.IPAddress + ",1433;" & _
            "Network Library=DBMSSOCN;" & _
            "Initial Catalog=Tablename;" & _
            "Integrated Security=SSPI;"
        Else
        '   DSN name
            NTAuthentication.SQLMailing.ConnectionString = "Provider=sqloledb;" & _
            "Data Source=" + Start.IPAddress + ";" & _
            "Initial Catalog=Tablename;" & _
            "Integrated Security=SSPI;"
        End If


At 04:38 PM 3/6/2002 +0000, you wrote:
>Hi All
> 
>Just wondering if i can connect to a database that is not on my network but is accessible over the internet i have full access
to the server but it is on a different network and i dont want to set up a vpn that that links the two networks i somehow want to be
able to run querys to sql server over tcp/ip is this possible ???
> 
>Thanks In Advance
> 
>Ian Jowett
> 
>Software Engineer



  Return to Index