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. Error conexion with vbNet 2005 but not with others

Error conexion with vbNet 2005 but not with others

Scheduled Pinned Locked Moved Visual Basic
helpdatabasesql-serversysadmin
5 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.
  • S Offline
    S Offline
    Serpiente
    wrote on last edited by
    #1

    Hello, I have this sub: Sub ConDB() Dim oSqlCliCon As SqlConnection oSqlCliCon = New SqlConnection("Data Source=120.260.9.8;Integrated Security=SSPI;Initial Catalog=pubs") Try oSqlCliCon.Open() Catch ex As Exception msgbox(ex.Message) End Try oSqlCliCon.Close() End Sub The problem: The code works for VB6/VBNET/VBNET2003 for SQL SERVER for VBNET2005 works only local but for the SQL SERVER don't. The exception message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The exception message if modify the connectionstring: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Please help, thank you. gangeles

    D 1 Reply Last reply
    0
    • S Serpiente

      Hello, I have this sub: Sub ConDB() Dim oSqlCliCon As SqlConnection oSqlCliCon = New SqlConnection("Data Source=120.260.9.8;Integrated Security=SSPI;Initial Catalog=pubs") Try oSqlCliCon.Open() Catch ex As Exception msgbox(ex.Message) End Try oSqlCliCon.Close() End Sub The problem: The code works for VB6/VBNET/VBNET2003 for SQL SERVER for VBNET2005 works only local but for the SQL SERVER don't. The exception message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The exception message if modify the connectionstring: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Please help, thank you. gangeles

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Your question doesn't make much sense. Are you trying to connect to a SQL Server 2005 database?? If so, you have to go into the SQL Server configuration manager and turn on TCP/IP connections. By default, an SQL Server 2005 installation will only accept connections from applications running on the machine the server is installed on. Dave Kreskowiak Microsoft MVP - Visual Basic

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Your question doesn't make much sense. Are you trying to connect to a SQL Server 2005 database?? If so, you have to go into the SQL Server configuration manager and turn on TCP/IP connections. By default, an SQL Server 2005 installation will only accept connections from applications running on the machine the server is installed on. Dave Kreskowiak Microsoft MVP - Visual Basic

        S Offline
        S Offline
        Serpiente
        wrote on last edited by
        #3

        Dave thank you for your response, We work with VB6, VB.NET, VB.NET.2003 and the last VB.NET.2005 We try to walk with the technology. When work with VB6, VB.NET, VB.NET.2003 don't have problem, what I can say, we don't to change nothing because works fine. But, since install VB.NET.2005 and try to do an application don't can stablish a conexion to the server. So, we don't need to change the configuration but meaby vb.net.2005 requieres to change, and we don't have the config to change, I look on sql-server-tool and have de TCP/IP added (enabled), you refer to this? The NET Principal Server (have the DB) Have a Domain We attach to the domain I test on two ways from client to server and server to client to stablish conexion but don't stablish. Hope that you can help us gangeles

        D 1 Reply Last reply
        0
        • S Serpiente

          Dave thank you for your response, We work with VB6, VB.NET, VB.NET.2003 and the last VB.NET.2005 We try to walk with the technology. When work with VB6, VB.NET, VB.NET.2003 don't have problem, what I can say, we don't to change nothing because works fine. But, since install VB.NET.2005 and try to do an application don't can stablish a conexion to the server. So, we don't need to change the configuration but meaby vb.net.2005 requieres to change, and we don't have the config to change, I look on sql-server-tool and have de TCP/IP added (enabled), you refer to this? The NET Principal Server (have the DB) Have a Domain We attach to the domain I test on two ways from client to server and server to client to stablish conexion but don't stablish. Hope that you can help us gangeles

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          There's nothing to change! You might want to look into making sure that you have the latest MDAC[^] installed. Dave Kreskowiak Microsoft MVP - Visual Basic

          S 1 Reply Last reply
          0
          • D Dave Kreskowiak

            There's nothing to change! You might want to look into making sure that you have the latest MDAC[^] installed. Dave Kreskowiak Microsoft MVP - Visual Basic

            S Offline
            S Offline
            Serpiente
            wrote on last edited by
            #5

            Dave Than you again for your response. Exactly, we now test with the 3 forms to connect: 1. Standard Security 2. Trusted Connection 3. Connect via an IP address (referer : http://www.connectionstrings.com/) So, we have 3 more servers and try to connect to them, but only one server failed to connect. I think like you is a configuration (meaby SQL server) or software to install problem, but We don't know what it´s. We can follow like first step the MDAC gangeles

            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