Results 1 to 6 of 6
  1. #1
    Join Date
    May 2004
    Posts
    3

    Exclamation Unanswered: SQL server connection over Internet ??

    Hi all developers...

    Please help me for connect to SQL server over internet.
    What is the connection string in VB6 ?

    And what is the different techniques do this ?

    Thanks..

  2. #2
    Join Date
    Sep 2003
    Posts
    522
    it depends on what object model for data access you choose. but in general, you can just specify the ip address of the server.

  3. #3
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Look at www.connectionstrings.com for information on connecting with various technologies.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  4. #4
    Join Date
    May 2004
    Posts
    3

    SQL server connection

    What is the sample connection string for connecting to SQL server over internet with ADO ??

  5. #5
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Quote Originally Posted by suat
    What is the sample connection string for connecting to SQL server over internet with ADO ??
    Well, let me just quote the connection strings from www.connectionstrings.com since you don't want to look it up.

    OLE DB, OleDbConnection (.NET)


    Standard Security:

    "Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"



    Trusted Connection:

    "Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
    (use serverName\instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)
    Prompt for username and password:

    oConn.Provider = "sqloledb"
    oConn.Properties("Prompt") = adPromptAlways
    oConn.Open "Data Source=Aron1;Initial Catalog=pubs;"



    Connect via an IP address:

    "Provider=sqloledb;Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
    (DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
    SqlConnection (.NET)


    Standard Security:

    "Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
    - or -
    "Server=Aron1;Database=pubs;User ID=sa;Password=asdasd;Trusted_Connection=False"
    (booth connection strings produces the same result)




    Trusted Connection:

    "Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
    - or -
    "Server=Aron1;Database=pubs;Trusted_Connection=Tru e;"
    (booth connection strings produces the same result)

    (use serverName\instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)
    Connect via an IP address:

    "Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
    (DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
    Declare the SqlConnection:

    C#:
    using System.Data.SqlClient;
    SqlConnection oSQLConn = new SqlConnection();
    oSQLConn.ConnectionString="my connectionstring";
    oSQLConn.Open();


    VB.NET:
    Imports System.Data.SqlClient
    Dim oSQLConn As SqlConnection = New SqlConnection()
    oSQLConn.ConnectionString="my connectionstring"
    oSQLConn.Open()
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  6. #6
    Join Date
    May 2004
    Posts
    3

    to derrickLeggett

    Thank you derrickleggett.. I will try it...

    I look it "connectionStrings.com" for SQL connection (over internet) string .
    But, there is not sample connection string what I want.

    Thank you again...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •