Sunday, February 19, 2012

Client Side Connectivity to SQL Server 2005

Hello All
I am an Oracle DBA currently learning SQL Server. I have downloaded
SQL Server Express 2005 and installed it including Northwind and pubs
databases. This worked just fine. Got the Server Management Studio
Express CTP and installed it and that too works just fine - on the
same machine as SQL Server
I would now like to access the data via another machine (XP
Professional, Visual Studio 2003.
I tried writing a simple C# program - keep getting "SQL Server does
not exist or access denied" messages no matter what connection string
I try in SQLConnection. OK, obviously problems - lets try to connect
via another method.
So I installed Server Management Studio Express CTP on the client
machine. SMSECTP can see the server in the browser but always refuses
to connect with a message (to paraphrase) "the problem may be that the
SQL Server is not configured to accept remote connections". Ah-Ha I
think, so I dig around and have enabled both TCP and Named Pipes using
the Surface Area utility and rebooted both client and server. This had
no effect on the problem at all.
So I am stuck. All of the diagnositic info I have read seems to
indicate that I should test things using client side tools such as
osql which I have not got on the client machine.
Is the client stuff downloadable? Any ideas on how to fix the problem?
Where do I go from here? I am getting pretty frustrated.
Kind regards
DaleWhat kind of logon are you trying to use? Integrated Security (SSPI) or a
SQL-Server login account and password?
If you don't want to use Integrated Security, the authentification process
of SQL-Server must be set to the mixed mode, then you must create a
SQL-Server login account, gives it the proper accessibility rights to the
database and use it in your connection (you could also use the SA account).
This will work only with a SQL-Server account, not a Windows account, ie you
cannot directly give to SQL-Server the name of a Window account and its
password to login and you must use Integrated Security instead.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"FrustratedXOracleBod" <NoSpam@.NoSpam.com> wrote in message
news:ggsoo1l36on8neugikig418466re5hm2jt@.
4ax.com...
> Hello All
> I am an Oracle DBA currently learning SQL Server. I have downloaded
> SQL Server Express 2005 and installed it including Northwind and pubs
> databases. This worked just fine. Got the Server Management Studio
> Express CTP and installed it and that too works just fine - on the
> same machine as SQL Server
> I would now like to access the data via another machine (XP
> Professional, Visual Studio 2003.
> I tried writing a simple C# program - keep getting "SQL Server does
> not exist or access denied" messages no matter what connection string
> I try in SQLConnection. OK, obviously problems - lets try to connect
> via another method.
> So I installed Server Management Studio Express CTP on the client
> machine. SMSECTP can see the server in the browser but always refuses
> to connect with a message (to paraphrase) "the problem may be that the
> SQL Server is not configured to accept remote connections". Ah-Ha I
> think, so I dig around and have enabled both TCP and Named Pipes using
> the Surface Area utility and rebooted both client and server. This had
> no effect on the problem at all.
> So I am stuck. All of the diagnositic info I have read seems to
> indicate that I should test things using client side tools such as
> osql which I have not got on the client machine.
> Is the client stuff downloadable? Any ideas on how to fix the problem?
> Where do I go from here? I am getting pretty frustrated.
> Kind regards
> Dale|||On Tue, 29 Nov 2005 12:14:41 -0500, "Sylvain Lafontaine" <sylvain aei
ca (fill the blanks, no spam please)> wrote:

>What kind of logon are you trying to use? Integrated Security (SSPI) or a
>SQL-Server login account and password?
>If you don't want to use Integrated Security, the authentification process
>of SQL-Server must be set to the mixed mode, then you must create a
>SQL-Server login account, gives it the proper accessibility rights to the
>database and use it in your connection (you could also use the SA account).
>This will work only with a SQL-Server account, not a Windows account, ie yo
u
>cannot directly give to SQL-Server the name of a Window account and its
>password to login and you must use Integrated Security instead.
Hi Sylvain
I have tried these two connection strings, with both MARINERIS and
MARINERIS\\SQLEXPRESS in the string
"Data Source=MARINERIS;Initial Catalog=Northwind;Integrated
Security=SSPI"
"Data Source=MARINERIS\\SQLEXPRESS; Initial Catalog=Northwind; User
ID=sa; Password=manager");
At the moment I would settle for any connectivity at all. Is it
possible this is a firewall issue? Both machines are on the same
network but XP (the OS of both machines) has a built in firewall.
There is no problem accessing the database via the CTP enterprice
manager on the box local to the database.
Cheers
Dale|||Are you sure this is the correct SQL server instance name? And is the double
backslash required by C#?
ML|||The double backslash \\ characters are required in C# if the string is not
prefixed with @. and if it's written in the C# code but not if it's in a XML
configuration file.
The suggestion about the SQL-Server instance is a good one. Another
possibility would be to make sure that the firewall is not the problem here:
if MSDE or SQL-2000 are already running on the machine, than the named
instance must use another port than 1433 because it's a second instance.
This problem won't show up when connecting from the local machine because a
named pipe will be used instead.
You should also make sure that the TCP/IP protocol has not been be disabled
by default when installing SQL-Server Express: take a look with the
SQL-Server Configuration Manager not only for Client Protocols but also for
the SQL-Server 2005 Protocols: both must be enabled.
If nothing work, then try disabling the firewall, stopping the SQL-Server
2000 service or setting another port than 1433 for SQL-Server 2005. As I
don't have two machines, I cannot tell you anymore about this problem right
now.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"ML" <ML@.discussions.microsoft.com> wrote in message
news:11EF062D-0FCF-44D9-961D-AA74003109A0@.microsoft.com...
> Are you sure this is the correct SQL server instance name? And is the
> double
> backslash required by C#?
>
> ML|||Hello All
This is now resolved. Thank you very much to all who replied.
I imagine this is going to be a pretty common question so I have
written up a web page on how to resolve the issue.
Here's the link:
http://www.datamasker.com/SSE2005_NetworkCfg.htm
Thanks again to all who helped
Cheers
Dale
On Tue, 29 Nov 2005 15:33:10 +0000 (UTC), FrustratedXOracleBod
<NoSpam@.NoSpam.com> wrote:

>Hello All
>I am an Oracle DBA currently learning SQL Server. I have downloaded
>SQL Server Express 2005 and installed it including Northwind and pubs
>databases. This worked just fine. Got the Server Management Studio
>Express CTP and installed it and that too works just fine - on the
>same machine as SQL Server
>I would now like to access the data via another machine (XP
>Professional, Visual Studio 2003.
>I tried writing a simple C# program - keep getting "SQL Server does
>not exist or access denied" messages no matter what connection string
>I try in SQLConnection. OK, obviously problems - lets try to connect
>via another method.
>So I installed Server Management Studio Express CTP on the client
>machine. SMSECTP can see the server in the browser but always refuses
>to connect with a message (to paraphrase) "the problem may be that the
>SQL Server is not configured to accept remote connections". Ah-Ha I
>think, so I dig around and have enabled both TCP and Named Pipes using
>the Surface Area utility and rebooted both client and server. This had
>no effect on the problem at all.
>So I am stuck. All of the diagnositic info I have read seems to
>indicate that I should test things using client side tools such as
>osql which I have not got on the client machine.
>Is the client stuff downloadable? Any ideas on how to fix the problem?
>Where do I go from here? I am getting pretty frustrated.
>Kind regards
>Dale

No comments:

Post a Comment