all groups > sql server (alternate) > november 2003 >
You're in the

sql server (alternate)

group:

cannot connect to SQL Server from VB.NET


cannot connect to SQL Server from VB.NET magicsoft714 NO[at]SPAM yahoo.com
11/26/2003 1:07:16 PM
sql server (alternate): 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.

Re: cannot connect to SQL Server from VB.NET jbellnewsposts NO[at]SPAM hotmail.com
11/27/2003 7:28:01 AM
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

[quoted text, click to view]
Re: cannot connect to SQL Server from VB.NET magicsoft714 NO[at]SPAM yahoo.com
11/27/2003 4:09:26 PM
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

[quoted text, click to view]
Re: cannot connect to SQL Server from VB.NET magicsoft714 NO[at]SPAM yahoo.com
11/27/2003 4:09:49 PM
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

[quoted text, click to view]
Re: cannot connect to SQL Server from VB.NET John Bell
11/28/2003 9:50:31 AM
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


[quoted text, click to view]

AddThis Social Bookmark Button