Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Connecting to SQL Server 2005 on a server in a workgroup

2 views
Skip to first unread message

BobRoyAce

unread,
Jun 15, 2006, 8:49:59 PM6/15/06
to
I have a bunch of lcient PCs that are primarily running Windows XP and
Windows 2003 and they all belong to the same workgroup. In addition, I
have a server PC that is running SQL Server 2005 and it also belongs to
the same workgroup. I am writing a Windows Forms application, using
Visual Studio 2005, which needs to run on each of the client PCs, and
which needs to communicate with the SQL Server 2005 database server.
The connection string below, which works if I run the application on
the server box itself, does not work on the client PCs. What do I need
to change to make this work?

Data Source=R-SERVER\RSERVER;Initial Catalog=KERMIT;Persist Security
Info=True;User ID=bobrod;Password=toad4x;Connect Timeout=0;Packet
Size=4096

Note the Machine name of the Server box is R-SERVER and the instance
name I used for the SQL Server 2005 server is RSERVER.

Kerry Moorman

unread,
Jun 16, 2006, 9:57:03 AM6/16/06
to
Bob,

When you say that the connection string does not work on the client PCs,
what do you mean?

Are you getting a specific error message when trying to connect, at timeout,
or what?

Kerry Moorman

BobRoyAce

unread,
Jun 16, 2006, 10:08:56 AM6/16/06
to
That's a good question. I just got a message from the client saying
that the application couldn't connect to the server from the client
PCs. I don't yet know what the specific error message or number was,
though. I'll try to find out.

Norman Yuan

unread,
Jun 16, 2006, 10:15:33 AM6/16/06
to
The first thing I'd check is the SQL Server2005 Express's configuration. By
default, SQL Server2005 installation disables remote connection. You need to
explicitly enable it.

If your SQL Server Express installed correctly, you can click
Start->Program->Micorsoft SQL Server 2005->Configuration Tools->Sql Server
Surface Area Configuration. Once the tool app started, on the treeview,
selecct MSSQLSERVER->Database Engine->Remote Connection node, then select
"Local and remote connection radio button.


"BobRoyAce" <br...@omegasoftwareinc.com> wrote in message
news:1150418999....@r2g2000cwb.googlegroups.com...

BobRoyAce

unread,
Jun 19, 2006, 12:52:41 PM6/19/06
to
I checked that and it was set to "Local and remote connection"

I changed the connection string to timeout after 60 seconds and it
does, in fact, timeout giving an error that it can't establish a
connection. A network guy pu an lmhost file on the client PC to resolve
R-SERVER to an IP address but still no-go. Then we changed the
configuration to allow for TCP/IP and named pipes...still no-go.

The connection string works just fine when run from the server box.
Does the connection string need to be different in some way to run from
client machines?

BobRoyAce

unread,
Jun 19, 2006, 1:00:56 PM6/19/06
to
NOTE: This is a modified repost of
http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/browse_thread/thread/f50e59feea1d12ab?hl=en

I have a bunch of lcient PCs that are primarily running Windows XP and
Windows 2003 and they all belong to the same workgroup. In addition, I
have a server PC that is running SQL Server 2005 and it also belongs to
the same workgroup. I am writing a Windows Forms application, using
Visual Studio 2005, which needs to run on each of the client PCs, and
which needs to communicate with the SQL Server 2005 database server.
The connection string below, which works if I run the application on
the server box itself, does not work on the client PCs. What do I need
to change to make this work?

Data Source=R-SERVER\RSERVER;Initial Catalog=KERMIT;Persist Security
Info=True;User ID=bobrod;Password=toad4x;Connect Timeout=0;Packet
Size=4096

Note that the Machine name of the Server box is R-SERVER and the
instance
name I used for the SQL Server 2005 server is RSERVER. The SQL Server
is set up to allow for Local and remote connections using TCP/IP and
named pipes (tried just TCP/IP first with no success).

Someone also tried putting an lmhost file on the client PC to resolve


R-SERVER to an IP address but still no-go.

I changed the connection string to timeout after 60 seconds and it


does, in fact, timeout giving an error that it can't establish a
connection.

As mentioned, the connection string works just fine when run from the

William (Bill) Vaughn

unread,
Jun 19, 2006, 3:35:02 PM6/19/06
to
Have you run the Surface Area Configuration tool to enable the ports and
protocols?


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"BobRoyAce" <br...@omegasoftwareinc.com> wrote in message

news:1150736456....@p79g2000cwp.googlegroups.com...

BobRoyAce

unread,
Jun 19, 2006, 4:32:47 PM6/19/06
to
Yes, ran Surface Area Configuration tool and made sure that Local and
remote connections was enabled. We tried TCP/IP only setting as well as
TCP/IP and named pipes setting...neither worked.

BobRoyAce

unread,
Jun 19, 2006, 4:50:21 PM6/19/06
to
Bill:

I was just reading an entry in your blog, called "Getting and Staying
Connected," and shown below, and wonder if my problem might be related
to the issue described. It rings true with what I suspect is the
problem. Forgive my networking ignorance, but where would the DNS be
running? I'm suspecting it's provided by something running on the
Windows 2003 server box (on which SQL Server happens to be installed in
my case). Does the lmhost file that the networking guy put on the
client PC not ultimately serve the same purpose of helping to resolve
the server (put into Windows\system32\drivers\etc)? Is there something
we must install on the server box?

As an aside, I just played around with my home network configuring a
laptop running Windows 2003 to be named R-SERVER and have an instance
of SQL Server 2005 running called RSERVER. When I attempt to run the
application here at my house, I also get a connect failure. I have
turned off firewall software. Hmmm...

---BLOG TEXT BEGINS---
4. The DNS must be able to identify the named machine (it must resolve
to a valid IP address). If the DNS is not working, the server can't be
found. It might be necessary to alter the "hosts" file
(Windows\system32\drivers\etc) to map a specific machine name to an IP
address to circumvent this issue. DNS accessibility can be a function
of how the NIC is configured or the availability (state) of the domain
controller.
---BLOG TEXT ENDS---

William (Bill) Vaughn

unread,
Jun 20, 2006, 12:06:14 PM6/20/06
to
When you work in a network that has a domain controller, the DNS (Directory
Name Service) resolves names to specific system (by IP address). In a home
network or one without a DNS service, there is no need for a DNS service as
all of the members of the workgroup are visible--assuming your systems have
file sharing enabled and have properly configured the systems. No, I have
not worked with Workgroup configurations in some time. I recommend that a
domain controller be established and used to manage the domain members and
the rights assigned there-to. Can you ping the other workstations (from a
workstation)? What do you see from the XP file explorer when you explore the
Workgroup? Have you tried disabling the firewall--at least temporarily? Make
sure that the firewall has ports open that permit the TCP/UDP ports to
communicate with the network.

hth


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"BobRoyAce" <br...@omegasoftwareinc.com> wrote in message

news:1150750221....@f6g2000cwb.googlegroups.com...

BobRoyAce

unread,
Jun 21, 2006, 12:51:21 AM6/21/06
to
Please see comments below. Besides those, I am wondering if it could be
a licensing issue. How can I check to see how the SQL Server software
was installed as far as licensing is concerned? What should I check and
whoat should be looking for?

William (Bill) Vaughn wrote:
> When you work in a network that has a domain controller, the DNS (Directory
> Name Service) resolves names to specific system (by IP address). In a home
> network or one without a DNS service, there is no need for a DNS service as
> all of the members of the workgroup are visible--assuming your systems have
> file sharing enabled and have properly configured the systems. No, I have
> not worked with Workgroup configurations in some time. I recommend that a
> domain controller be established and used to manage the domain members and
> the rights assigned there-to.

OK...assuming filesharing is enabled on the server box, which rights
have to be given to what?

> Can you ping the other workstations (from a workstation)?

yes

> What do you see from the XP file explorer when you explore the Workgroup?

The client PCs have a drive mapped to the server and can see it from
Explorer through "My Network Places" where it shows up under the the
workgroup which shows up under "Entire Network\Microsoft Windows
Network.

> Have you tried disabling the firewall--at least temporarily?

Yes...

> Make sure that the firewall has ports open that permit the TCP/UDP ports to
> communicate with the network.

How do I do this? What are the actual ports that I need to open?

William (Bill) Vaughn

unread,
Jun 21, 2006, 1:33:38 PM6/21/06
to
Use the SQL Server configuration manager to view the specific server port
configurations. Depending on the server and the instances you have
installed, these can be TCP1433 or other ports. If you've disabled the
firewall then port blocking should not be an issue. One other factor: did
you enable the SQL Browser service on the server?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.

__________________________________

"BobRoyAce" <br...@omegasoftwareinc.com> wrote in message

news:1150865481.4...@m73g2000cwd.googlegroups.com...

BobRoyAce

unread,
Jun 22, 2006, 3:18:54 PM6/22/06
to
SQL Server Browser service is running on the server. We shut off
firewalls on client and server. Still no go...any other ideas?

BobRoyAce

unread,
Jun 22, 2006, 3:27:18 PM6/22/06
to
By the way, file sharing is turned on (server is a fileserver), but am
wondering what folders we need to give users permission to. Please
advise...

0 new messages