473,802 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB .net Service cannot connect to sql 2000

Ok guys I have racked my brain on this one.

I have a vb .net service installed on a win2k server. I am trying to
get it to connect to sql 2000 box but I get this error:

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)

I have remote connection turned on, on the sql2000. I have tried the
following connection strings

data source=<IP>;ini tial catalog=dfcdb;p ersist security info=False;user
id=user;passwor d=PW;packet size=4096

data source=(local); initial catalog=dfcdb;p ersist security
info=False;user id=user;passwor d=PW;packet size=4096

data source=tcp:<IP> ;initial catalog=dfcdb;p ersist security
info=False;user id=user;passwor d=PW;packet size=4096

data source=<IP>:143 3;initial catalog=dfcdb;p ersist security
info=False;user id=user;passwor d=PW;packet size=4096 (that port is
open)

The service is set to run under my log on.

I made a windows app that tests connection strings and the first 3
work. I tested the service on a local machine with a local sql 2000 and
it works like a champ.

Here is the .net code to open the connection

'1. Create a connection
Dim SQLString As String = My.Settings.SQL ConnectionStrin g
Dim cn As New SqlConnection(S QLString)

cn.Open() <-- I think it breaks here
'2. Create the command object, passing in the SQL string
Const selectString As String = "GetRules"
Dim cmd As SqlCommand
cmd = New SqlCommand(sele ctString, cn)
cmd.CommandType = CommandType.Sto redProcedure

Dim reader As SqlDataReader = cmd.ExecuteRead er()

please help I have looked everywhere

Jan 8 '07
10 2371
Just a few problems that I have ran into, it might help, and it might
not help.

1. Some web hosts, do not allow adhoc connections to databases. I'm
sure this is not your problem. But, I have experienced web hosting
that does not support this in the past.

2. I think I have received an error similiar to your when one of the
sql services on the server was not running. I think the service name
was "sql server browser". It was not running and caused that issue.

Trouble shooting:
You could check and see if you can connect to the sql server, using the
..net server explorer. If you can not connect to the server.

In the past when I had a problem and could not connect to a server, I
uninstalled sql and then re-installed it.
Matt F wrote:
I hate to say it but I'm running out of ideas. There is always the "call
microsoft" option - although probably a costly one. I did google and ran
accross a few issues that people have had, but most seem to be resolved via
SQL service packs. If I think of anything else, I'll post back. I'm also
watching this thread because now I'm both curious and stumped. Please post
the solution if you find one. Sorry I couldn't be more help -- good luck!!!

"blurryimag e" <bl*********@gm ail.comwrote in message
news:11******** **************@ k58g2000hse.goo glegroups.com.. .
Thank you for your help on this.

I tried 127.0.0.1 and local and localhost with no luck. I also did an
ipconfig just to make sure it is the right address and it is.

I have a windows app that I made to test SQL connection strings It just
tells if the connection was made returning True or False. This program
(running as a windows app) works so I know the connection strings are
good. I run into the connection problem only when it is a windows
service.
Jan 12 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2492
by: Jack Smith | last post by:
Hello, I have PHP 4.3.1.1 running on Windows 2000 Server with IIS 5. This connects to an MS SQL 7 server running on a seperate NT4 box. Recently, this SQL7 Server had SQL7 Service Pack 4 applied to it. After this Service Pack, the PHP apps could no longer connect to the database. Warning: mssql_connect() : Unable to connect to server: <mySQLServer> in <myPHPapp.php> on line 12.
1
1848
by: Subodh | last post by:
Hi, I changed the login for MSSQLSERVER service for 6.5 box to "This account" from "system account" and then again changed back to "system account". Now I cann't connect thru Enterprize Manager to my server. All my services r running and I can connect to my database thru an application as before. I cannot re-boot the machine as it is in production. Any thoughts? Thanks in advance.
2
2133
by: Jay Chan | last post by:
We have just installed a SQL Server 2000 (SP 3A) onto a computer that has Windows-2003 Server on it. Now, we cannot get access to that database server from other computers. Seem like this may be an issue with Active Directory. Our network consists of Windows-2000 Servers (SP 4) and Windows-2000 workstations and Windows-XP workstations. We also have SQL Server 2000 (SP2) in three Windows-2000 servers. All work fine. Recently, we get a...
3
19719
by: Steve Lutz | last post by:
Hi All, I have a Windows Service that runs well. The service hosts a remote object. The purpose of the object is so that I can "peak" into the service to see what it's doing. I wrote a small Windows Application that connects to the remote object and prints out status information. Everything works fine when I first start the service. However, after some period, when I attempt to connect to the remote object, I get "Requested Service not...
1
1444
by: Scott McChesney | last post by:
Folks - We are running around and around here on a project we're developing, and I'm getting to the point that I don't know what I do and don't know. So I need some assistance. We are developing a web service that connects to an external LDAP server to validate a username/password that the user enters from a login page. Right now, we're concerned about interaction with an ASP.NET website, but this web service will also be used by...
3
3900
by: Richard | last post by:
I have created a Windows service which performs various functions including setting variables in other application objects. When the service runs under Local System account the functionality all works OK, however when service runs under a user account it produces exception errors when trying to set variables in the application objects. I created a .exe test harness which does the same and works OK when run by the same user.
10
1914
by: amirmira | last post by:
I have a Windows Service developed in VB.NET that attempts to connect to a database as soon as the service starts. I have no problem when I start the service manually - but when I restart the computer that hosts the service, I get a Null Reference Exception when I try to connect to the database (I have set the service to start automatically). Any ideas why this is happening? Thanks in advance. Ajay Mirmira
8
1811
by: Manfred Braun | last post by:
Hello All! I am writing a management application, which has to access remote machines registry via System.Diagnostics.EventLog.CreateEventSource . For each machine, I connect to, I create a DirectoryEntry and connect to that machine specifying credentials. That's becauase the running user does not has the right permissions . The application is written in C# and the action taken is done with threads from the threadpool.
1
2498
by: bitchanger | last post by:
I have installed an SQL Server 2000 Developer Edition (SP4) on a computer that has Windows Server 2003 on it.The server is connected to the workgroup "WORK" and has no Active Directory. Now I cannot connect to that database server from other computers in the network. On the server itself, I can registrate the instance from the own SQL Server 2000 and also an instance from an other SQL Server 2000 installation on a Windows 2000 Server in...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10305
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.