cannot connect to SQL Server from VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew

    cannot connect to SQL Server from VB.NET

    I have an application written in VB.NET that connects directly to a
    SQL Server 2000 database over the internet. It works fine on the
    development machine (XP Pro), as well as two outside machines running
    XP Pro. It does NOT work on two other outside machines, both running
    Win2000. All 4 outside machines have the latest .NET framework
    installed. I assume that XP has something by default that the 2000
    machines do not, but I have no idea what that something could be that
    would affect my software. I tried installing MDAC 2.8 as well as the
    "sqlredist. exe" on both 2000 machines, but no dice. Is there anything
    else I need to install, which XP just happens to already include? The
    code doesn't appear to be the issue, since it works on the two XP
    machines. And permissions and/or firewalls don't appear to be an
    issue for the same reason. Here is the code in question, if that
    helps:

    Public conTemp As SqlClient.SqlCo nnection

    conTemp = New SqlClient.SqlCo nnection("Data
    Source=xxx.xxx. xxx.xxx\servern ame;Network Library=DBMSSOC N;Initial
    Catalog=somenam e;User ID=username;Pas sword=password; ")

    conTemp.Open() 'this is the line where the error occurs

    The actual error is "Object reference not set to an instance of an
    object", as though the second line above was absent (I get the same
    error if I comment out the second line of code and run it on the
    development machine). I thought that maybe certain SQL Server drivers
    were needed in order for the SQLConnection to operate correctly, but I
    assume the MDAC and "sqlredist. exe" would have taken care of that if
    it was the problem. I'm out of ideas and appreciate any you guys
    might have.

    Andrew
  • John Bell

    #2
    Re: cannot connect to SQL Server from VB.NET

    Hi

    I can't think of an obvious reason for this. The XP firewall could
    have caused problems, but it seems to be the reverse of that,
    therefore is there any third party application that is being run
    instead on the 2000 machines or do these machines have something else
    using the port you are using?

    You don't say if the XP and 2000 machines are at the same location, on
    the same network/segment?

    Are the network configurations the same?

    Can you talk to other SQL servers?

    HTH

    John

    magicsoft714@ya hoo.com (Andrew) wrote in message news:<888f9cb6. 0311261307.2c59 bde7@posting.go ogle.com>...[color=blue]
    > I have an application written in VB.NET that connects directly to a
    > SQL Server 2000 database over the internet. It works fine on the
    > development machine (XP Pro), as well as two outside machines running
    > XP Pro. It does NOT work on two other outside machines, both running
    > Win2000. All 4 outside machines have the latest .NET framework
    > installed. I assume that XP has something by default that the 2000
    > machines do not, but I have no idea what that something could be that
    > would affect my software. I tried installing MDAC 2.8 as well as the
    > "sqlredist. exe" on both 2000 machines, but no dice. Is there anything
    > else I need to install, which XP just happens to already include? The
    > code doesn't appear to be the issue, since it works on the two XP
    > machines. And permissions and/or firewalls don't appear to be an
    > issue for the same reason. Here is the code in question, if that
    > helps:
    >
    > Public conTemp As SqlClient.SqlCo nnection
    >
    > conTemp = New SqlClient.SqlCo nnection("Data
    > Source=xxx.xxx. xxx.xxx\servern ame;Network Library=DBMSSOC N;Initial
    > Catalog=somenam e;User ID=username;Pas sword=password; ")
    >
    > conTemp.Open() 'this is the line where the error occurs
    >
    > The actual error is "Object reference not set to an instance of an
    > object", as though the second line above was absent (I get the same
    > error if I comment out the second line of code and run it on the
    > development machine). I thought that maybe certain SQL Server drivers
    > were needed in order for the SQLConnection to operate correctly, but I
    > assume the MDAC and "sqlredist. exe" would have taken care of that if
    > it was the problem. I'm out of ideas and appreciate any you guys
    > might have.
    >
    > Andrew[/color]

    Comment

    • Andrew

      #3
      Re: cannot connect to SQL Server from VB.NET

      I don't have any other SQL Servers which I can test against, and
      installing SQL Enterprise Manager on the 2000 machines to see if that
      works and/or fixes the issue isn't really an option I'd like to take.
      The XP and 2000 machines are all in the same house, on the same
      network. There isn't anything installed on the 2000 machines which
      would interfere with my app. As far as I can tell, everything is
      equal, other than the OS.

      Andrew
      [color=blue]
      > Hi
      >
      > I can't think of an obvious reason for this. The XP firewall could
      > have caused problems, but it seems to be the reverse of that,
      > therefore is there any third party application that is being run
      > instead on the 2000 machines or do these machines have something else
      > using the port you are using?
      >
      > You don't say if the XP and 2000 machines are at the same location, on
      > the same network/segment?
      >
      > Are the network configurations the same?
      >
      > Can you talk to other SQL servers?
      >
      > HTH
      >
      > John[/color]

      Comment

      • Andrew

        #4
        Re: cannot connect to SQL Server from VB.NET

        I don't have any other SQL Servers which I can test against, and
        installing SQL Enterprise Manager on the 2000 machines to see if that
        works and/or fixes the issue isn't really an option I'd like to take.
        The XP and 2000 machines are all in the same house, on the same
        network. There isn't anything installed on the 2000 machines which
        would interfere with my app. As far as I can tell, everything is
        equal, other than the OS.

        Andrew
        [color=blue]
        > Hi
        >
        > I can't think of an obvious reason for this. The XP firewall could
        > have caused problems, but it seems to be the reverse of that,
        > therefore is there any third party application that is being run
        > instead on the 2000 machines or do these machines have something else
        > using the port you are using?
        >
        > You don't say if the XP and 2000 machines are at the same location, on
        > the same network/segment?
        >
        > Are the network configurations the same?
        >
        > Can you talk to other SQL servers?
        >
        > HTH
        >
        > John[/color]

        Comment

        • John Bell

          #5
          Re: cannot connect to SQL Server from VB.NET

          Hi

          The easiest way to check the network would probably be to telnet into the
          given port on the server. This will show that the routing is ok. If that
          works it is probably something to do with the machine/software
          configuration.

          John


          "Andrew" <magicsoft714@y ahoo.com> wrote in message
          news:888f9cb6.0 311271609.5a684 72b@posting.goo gle.com...[color=blue]
          > I don't have any other SQL Servers which I can test against, and
          > installing SQL Enterprise Manager on the 2000 machines to see if that
          > works and/or fixes the issue isn't really an option I'd like to take.
          > The XP and 2000 machines are all in the same house, on the same
          > network. There isn't anything installed on the 2000 machines which
          > would interfere with my app. As far as I can tell, everything is
          > equal, other than the OS.
          >
          > Andrew
          >[color=green]
          > > Hi
          > >
          > > I can't think of an obvious reason for this. The XP firewall could
          > > have caused problems, but it seems to be the reverse of that,
          > > therefore is there any third party application that is being run
          > > instead on the 2000 machines or do these machines have something else
          > > using the port you are using?
          > >
          > > You don't say if the XP and 2000 machines are at the same location, on
          > > the same network/segment?
          > >
          > > Are the network configurations the same?
          > >
          > > Can you talk to other SQL servers?
          > >
          > > HTH
          > >
          > > John[/color][/color]


          Comment

          Working...