Solved

How to access sql server 2005 databse from client PC?

Posted on 2009-05-20
2
208 Views
Last Modified: 2012-08-13
PC1 : I have SQL server 2005 database , Win XP, IP = 192.168.0.2
PC2 : windows 2000, IP = 192.168.0.59

PC1 and PC2 are connected to each other.
Enabled SQL server 2005 database for remote connection with protocol TCP/IP and Named pipe both.

Now I want to access/use the SQL server 2005 database from PC2.

my connection string is
"ConnectString=Server=192.168.0.2;UID=test;PWD=test123;Database=HOTKEYDB"

But when I try to connect to the database it gives the error as below

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

How do I solve this problem?

Thanks in advance.
0
Comment
Question by:madhav_ghatole
2 Comments
 
LVL 2

Accepted Solution

by:
krishrr earned 500 total points
ID: 24429211
Try the following:

1. Enable remote connection with protocol TCP/IP and Named pipe both for both PC1 and PC2.

2. Make sure the double quotes  are properly placed as below:
ConnectString="Server=192.168.0.2;UID=test;PWD=test123;Database=HOTKEYDB"

3. Try to connect the database from PC2 with SQL Server Management Studio. If it connects properly then try to connect with code.

4. Try to connect with Server name instead of IP.



0
 

Author Closing Comment

by:madhav_ghatole
ID: 31583382
Thanks
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now