Friday, February 24, 2012

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.SqlConnection

conTemp = New SqlClient.SqlConnection("Data
Source=xxx.xxx.xxx.xxx\servername;Network Library=DBMSSOCN;Initial
Catalog=somename;User ID=username;Password=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.

AndrewHi

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@.yahoo.com (Andrew) wrote in message news:<888f9cb6.0311261307.2c59bde7@.posting.google.com>...
> 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.SqlConnection
> conTemp = New SqlClient.SqlConnection("Data
> Source=xxx.xxx.xxx.xxx\servername;Network Library=DBMSSOCN;Initial
> Catalog=somename;User ID=username;Password=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|||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

> 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|||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

> 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|||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@.yahoo.com> wrote in message
news:888f9cb6.0311271609.5a68472b@.posting.google.c om...
> 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
> > 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

No comments:

Post a Comment