Solved

How to access sql server 2005 databse from client PC?

Posted on 2009-05-20
2
214 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

696 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