Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Host an SqlServer 2005 Database on WIndows XP

Posted on 2009-05-18
10
Medium Priority
?
203 Views
Last Modified: 2012-08-13
Hello,  I have a little program i wrote which connects to a sql databse.  Until now I have just been using localhost in the command line.  I want to try and get it working so I can run my program from another computer (not on the same network).  

Is it possible to do this, if the machine hosting the sql database is Vista Professional?

If it is possible, I must be doing something wron becuase its not working.  
I am using the followin connection string:
connectionString="Data Source=123.123.123.123,1433\SQLEXPRESS;Initial Catalog=myDB;Integrated Security=True"

I have performed the steps listed here: http://support.microsoft.com/kb/914277
0
Comment
Question by:BobBarker_99
[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
  • 4
  • 4
  • 2
10 Comments
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24418314
port #1433 is default port and dont' need to specify it in connection string
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24418320
moreover, are you able to connect your SQL Express from other computer out of your network? I am sure it is not configured correctly....
0
 
LVL 31

Accepted Solution

by:
RiteshShah earned 800 total points
ID: 24418330
moreover, can you please try using sql authentication as your aspnet account may not be authenticated in your sql server. have a look at my article at

http://www.sqlhub.com/2009/04/error-fixed-cannot-open-database-dbname.html
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 1200 total points
ID: 24418355


I think you will have to use SQL Authentication, not Windows Authentication. So you will have to replace the "Integrated Security=True" with an SQL user ID and password. Also replace the Datasource with the IP Address and port #
Something like this:

"Data Source=xxx.xxx.xxx.xxx,1433;Initial Catalog=myDatabaseName;User ID=myUsername;Password=myPassword"
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24418368
yes, that is what I mentioned in my previous post either go for sql authentication or if it is possible make your ASPNET account trusted (create login) in your SQL express.
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24418373
I know Ritheshsa, I just wanted to explain how to change the connection string since you didn't explained that. :)
0
 

Author Comment

by:BobBarker_99
ID: 24428667
Ok, I have modified my connection string, and enabled sql login.  

When I use:
Data Source=\LOCALHOST;Initial Catalog=TutoringDB;User ID=myid;Password=mypass it works.

But
Data Source=xxx.xxx.xxx.xxx;Initial Catalog=TutoringDB;User ID=myid;Password=mypass
gives me teh following exception:

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

Any ideas?
0
 

Author Comment

by:BobBarker_99
ID: 24428741
I tried using tcp instead and got

Network=DBMSSOCN;Data Source=xxx.xxx.xxx.xxx;Initial Catalog=TutoringDB;User ID=myid;Password=mypass

(provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)"

0
 
LVL 41

Expert Comment

by:ralmada
ID: 24431706
Maybe there's a firewall blocking any connection to port 1433.
Also make sure SQL Browser agent is enabled
0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 1200 total points
ID: 24434551
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

618 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