Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VB SQL Connectivity through Internet.

VB SQL Connectivity through Internet.

Scheduled Pinned Locked Moved Visual Basic
questiondatabasesql-serversysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I have developed a client-server application in VB6 and SQL Server 7 as backend. The application works fine in our intranet. But I want to connect to the SQL Server physically located in our second office which is in different city. We have a fixed IP address. I am facing a problem in connecting to the SQL server. I have tried with DSN, provider, .udl file. How do I accomplish ths?

    L J 2 Replies Last reply
    0
    • L Lost User

      I have developed a client-server application in VB6 and SQL Server 7 as backend. The application works fine in our intranet. But I want to connect to the SQL Server physically located in our second office which is in different city. We have a fixed IP address. I am facing a problem in connecting to the SQL server. I have tried with DSN, provider, .udl file. How do I accomplish ths?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I have done this many times with the following code. Basically, I create a connection string and use ADO and OLEDB to perform the connection. Here is a code snippet. strServerName = "127.0.0.1" ' Substitute your IP Address here strDatabaseName = "YourDB" ' Substitute your Database name strUserName = "YourUser" ' Substitute your UserName strPassword = "Password" ' and Pasword here. ' Initialize the database connection string mstrConnStr = "server=" & strServerName & ";database=" & strDatabaseName & ";provider=SQLOLEDB;uid=" & strUserName & ";pwd=" & strPassword ' Instantiate an ADO Connection Object - Trivial code left out ' Then, open the connection. mobjConn.Open mstrConnStr ' Do some error checking here That's all there is to it! Rob

      1 Reply Last reply
      0
      • L Lost User

        I have developed a client-server application in VB6 and SQL Server 7 as backend. The application works fine in our intranet. But I want to connect to the SQL Server physically located in our second office which is in different city. We have a fixed IP address. I am facing a problem in connecting to the SQL server. I have tried with DSN, provider, .udl file. How do I accomplish ths?

        J Offline
        J Offline
        Jason Cono
        wrote on last edited by
        #3

        You need to make sure that the SQL Server is set up to use TCP\IP protocol and then on your client machines in the setup of the DSN you need to make sure they are trying to connect via TCP and not Named Pipes (which would only work in you intranet). Jason Cono, MCSD

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups