Welcome to MSDN Blogs Sign in | Join | Help

SQL Protocols

Topics from the Microsoft SQL Server Protocols team - Netlibs, TDS, SQL Browser, etc...
Troubleshoot Connectivity Issue with SQL Server Express 2005

Recently, we answered a lot of customer questions about how to make a successful connection to SQL Express 2005 through MSDN forum and our blogs. Here, I collect basic info about it and a brief guide of making local and remote connection to SQL Server Express 2005.

Part I - Quick overview with SQL Server 2005 Express Edition:

http://msdn.microsoft.com/vstudio/express/sql/

http://msdn.microsoft.com/sql/express/

http://www.microsoft.com/sql/editions/express/default.mspx

 

Part II - SqlExpress Weblog and Forum:

http://blogs.msdn.com/sqlexpress/default.aspx

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=385&SiteID=1

 

Part III - SQL Express Connectivity

From Protocols point of view, I would like to give a brief guide about how to make a successful connection against Express Server from your client application.

First: Make sure the instance is running.

By default, SQL Server Express Edition is installed as a *Named Instance*, namely, it is not default instance called MSSQLSERVER, instead, by running "net start" or open services control manager, you will see a service named "MSSQL$SQLEXPRESS" running after installation. So, the instance name is "SQLExpress".

 

Secondly: Check Server ERRORLOG

Two ways:

1) By open the properties of the service, you will see the binary location, such as "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe", so normally, if you do not change configuration for the log file location, it should be located ...\MSSQL.X\MSSQL\Log\. When you open the log file, you should see some keywords such as " Express Edition " and " Server name is '<machinename>\SQLEXPRESS' " and " Server named pipe provider is ready to accept connection on [ \\.\pipe\MSSQL$SQLEXPRESS\sql\query ]", etc.

2) Go to SQL Server Configuration Manager, open " SQL Server 2005 Services", choose "properties" for SQLExpress, in the advanced tab, there is a Filed called "Startup Parameter", you will find configured server log file location.

If your server was not started successfully by any reason, it is very helpful to collect info from server logs; also, you can get clear picture of protocols that server is listening on, for eg, if TCP was enabled, you should be able to see which port server is listening on, and if Np was enabled, you can make connection throgh the pipe name.

 

Thirdly: Make sure SQL Browser is enabld and running.

To enable browser, First, Use net start or go to sql configuration manager(SSCM), check whether sqlbrowser service is running, if not, start it; Secondly,You still need to make sure SqlBrowser is active. Go to SSCM, click properties of sqlbrowser service -> Advanced-> Active “Yes” or “No”, if sqlbrowser is running but is not active, the service would not serve your client with correct pipe name and Tcp port info on which your connection depends.

 

Fouthly: Configure Express if you want to mak remote connection.

By default, Named Pipe and TCP/IP Protocols were disabled after installation of SQL Express, hence, if you want to make named pipe and tcp connection, you need to follow the below instructions: http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

 

Finally: Make sure correct connection string in your client application.

There are bunch of connection properties that you can specify for a SQL Connection through different providers, here, I just point to the "Server" field that point to which instance you want to connect.

Remember whenever you make connection to Express, it is a named instance, namely, you need to specify the instance name in the connection string.

 

Best practice, especially the server part in conection string.

Local Connection:

"Provider=SQLNCLI;Server=<MachineName>\SQLEXPRESS;Initial Catalog=master;Integrated Security=SSPI ";

<MachineName> could be ".", "(local)","localhost", "<localhostname>".

Remote Connection:

"Provider=SQLNCLI;Server=<MachineName>\SQLEXPRESS;Initial Catalog=master;Integrated Security=SSPI ";

<MachineName> could be "<remotehostname>", "<remoteIPAddress>","<FQDNofremotemachine>".

If you do not want to put intance name in the connection string, you can avoid that by specifying alias or "<machinename>,port", but we do not recommend those, since those are not convienient for you druing troubleshooting.

 

Summary:

If you encounter any questions about connectivity issue with SQL Express, please bring any exception that you saw for the above steps, and we will help you to solve the problem.

 

MING LU

SQL Server Protocols

Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights


 

 

Posted: Thursday, March 23, 2006 3:39 AM by SQL Protocols

Comments

melville said:

Thanks for this I shall post and link to here.  I was asked a general question which this should answer
# March 30, 2006 8:14 AM

rgoodson40 said:

I have installed Express 2005 on a Win2k computer. I am able to connect to the server with no problem from this machine. When I try to this Server from an XP computer on the same LAN, I get the following error:
"Run-time error '3707': Provider cannot be found. It may not be properly installed."

Do you know what could be wrong?

I am attempting to connect through a connectionstring in a VB6 application. I am using the same connectionstring on both computers.

the connectionstring is as follows:
strConn = "DRIVER={SQL Native Client};SERVER=Reagan-AOPEN\sqlexpress;" & _
               "DATABASE=Northwind;UID=Reagan;PWD=Reagan2006;"
# April 7, 2006 2:50 AM

Jimmy Wu said:

SQL Express 2005 installs a new native driver called SQL Native Client, which is what you are using in the connection string.  On the WinXP machine you have on the network, from the error message, it appears that it does not have SQL Native Client installed.  You can either install the new driver from
http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en
or you can change the "DRIVER" value to "DRIVER={SQL Server}" which will use MDAC.

HTH
# April 7, 2006 2:20 PM

Ali said:

after reinstalling SQL server express edition, I changed the server name. Now I am getting alot of errors. For example, The connection provider in ASP.NET configuration is not able to connect to the database. should I change the information in machine.config? I am really confused by the new design of vs2005
# April 29, 2006 3:56 AM

Matt Neerincx [MSFT] said:

You should not need to change anything in machine.config.  Renaming the computer after installing SQL can cause problems, I have seen this in the past with older versions of SQL.  I would suggest un-installing and re-installing SQL Server Express Edition again now that the computer is renamed.
# May 1, 2006 2:21 PM

pc said:

I'm trying to connect using ASP 3.0 using the native client provider, I get the following error: " Response object, ASP 0104 (0x80070057)
Operation not Allowed"

any ideas?
# June 9, 2006 12:44 PM

SQL Protocols said:

Hi,

 If you search the errorstring, you can find helpful website about the problem, it most likely in your client APP.

http://www.codingforums.com/showthread.php?t=54066

Thanks!
Ming.
# June 9, 2006 1:42 PM

Kavitha Damodhiran said:

Hi Ming,
I am trying to connect to SQL Server 2005 Database remotely using ODBC connection Object (my requirement). the owner of the database is xx and currently i am accessing with xx login only. the permissions of the database has 'guest' added to with grant for 'Connect' enabled. but while executing the code the error i got is "Login failed for user xx. Database yy cannot be opened. login failed for xx." kindly help me out.

# June 29, 2006 2:06 AM

SQL Protocols said:

Hi, Kavitha

   Seems like you made successful connection, just need grant login for xx in your server database. Check sql booksonline might help to what is the process.

   Also, this forum can quickly resolve your issue. Please post your question there.

   http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=92&SiteID=1

Good Luck!
Ming.
   

# June 29, 2006 2:01 PM

rape movies said:

Asaspal. Memrano tu es besta. Amigo.
# June 30, 2006 2:41 AM

David said:

最近在烦恼,怎么就不能远程访问SQL2005的呢!怎么搞也搞不明白! 参考了下面的两个Blog,终于清晰了。 http://blogs.msdn.com/sql_protocols/ar...
# July 19, 2006 4:45 AM

Eric said:

I have SQL Express SP1, with just Shared Memory protocol enabled.  I installed using advanced settings and changing it to install as the Default Instance not the named instance.

I am using MDAC OLEDB, connection string like "Provider=SQLOLEDB..."

I can connect using "(local)", but I cannot connect as <machinename>.   When I try the latter I just get an error of "Timeout expired"

On your blog earlier you said you need to use <machinename> if Shared Memory is the only enabled protocol.

Just a little confused about this, and would appreciate a little info.

Thanks!
# August 17, 2006 6:44 PM

SQL Protocols said:

Hi, Eric

   The error indicated that your connection was not established within the specified timeout or default timeout. So the workaround here is to enlarge connection timeout, since you are using OLEDB provider, you can directly add "Connect Timeout=120" in your connection string. The reason behind might due to when you use <machinename>, during first connection using it, MDAC would resolve it to ipaddress, so the time to make connection including the time to DNS resolution. If you try the connection for the second time, you would not came across "timeout expired" since there was cache on your machine.

Good Luck!
Ming.
# August 19, 2006 8:02 PM

Dan said:

Hi Eric,

The server was working then suddenly stopped.  Any ideas?  All commands run below were on the local machine through a TS connection, if that makes any difference.

From ERRORLOG:

2006-09-11 21:07:03.59 spid4s      Server name is 'COMPUTER_NAME\SQLEXPRESS'. This is an informational message only. No user action is required.
2006-09-11 21:07:03.62 spid4s      Starting up database 'msdb'.
2006-09-11 21:07:03.84 Server      The certificate was successfully loaded for encryption.
2006-09-11 21:07:03.95 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\SQLEXPRESS ].
2006-09-11 21:07:03.95 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\MSSQL$SQLEXPRESS\sql\query ].


C:\Documents and Settings\Administrator>osql -E -S 127.0.0.1\SQLEXPRESS

[SQL Native Client]SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
[SQL Native Client]Login timeout expired
[SQL Native Client]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.

C:\Documents and Settings\Administrator>osql -E -S COMPUTER_NAME\SQLEXPRESS
[SQL Native Client]Shared Memory Provider: No process is on the other end of the pipe.
[SQL Native Client]Client unable to establish connection

C:\Documents and Settings\Administrator>osql /S\\.\pipe\MSSQL$SQLEXPRESS\sql\query /E
[SQL Native Client]Named Pipes Provider: No process is on the other end of the pipe.
[SQL Native Client]Client unable to establish connection

C:\Documents and Settings\Administrator>osql /S\\.\pipe\SQLLocal\SQLEXPRESS  /E
[SQL Native Client]Named Pipes Provider: No process is on the other end of the pipe.
[SQL Native Client]Client unable to establish connection
# September 12, 2006 2:28 AM

GaryB said:

Hi Ming,

Thank you very much for this post - I was beginning to lose hope that someone from Microsoft cared that so many of us are battling with this problem!

I am trying to configure my machine to allow me to connect to a local database file - rather than via SQL Server.

Here is my connection string, which works fine on my client's server and worked fine on my development machine under VWD Express / SQL Server Express before I installed Visual Studio 2005 Team Suite (Eval) + SQL Server 2005.

I am running XP Professional 2002 SP2, Visual Studio 2005 Team Suite (Evaluation), Visual Web Developer Express and SQL Server Express.

The short story is that I am able to run my ASP.NET applications quite happily under the Default Development Server (//localhost:2661/SQLServerExpressTest/Default.aspx for example), but //localhost/SQLServerExpressTest/Default.aspx generates the following error:

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

I would really like to be able to demonstrate my applications to clients without having to run VS to run the Development Server - I am bootstrapping my development business and want to join the Microsoft Empower program as soon as I can afford to, so that I can use VS 2005 Professional in anger.

I also need to be able to get a code-generator I'm beta testing to be able to read the data from SQL Express database files - and to run database file based DotNetNuke websites.

I have done the following in various attempts totalling over 60 hours in the last 4 months or so:
1.  Checked that the SQL Server instance is running.
2.  Checked that the SQL Browser is enabled and running.
3.  Ensured that the folder is configured as an application in IIS.
4.  Checked that Network Service - and Everyone, for that matter - is configured with full rights on the App-Data folder and files.
5.  Checked the TCP/IP and Named Pipes are both enabled.
6.  Deleted the (User specific) SQL Server Express Directory and rebooted.
7.  Tried the SQL Express and teh SQL Server versions of the SQL Express executable.

I've listed the various threads I've looked at and tried to implement to get things going under my signature.

My connection string is:

<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

To reiterate, from an outcome point of view, I would love to be able to point IE to //localhost/foldername and have my ASP.NET data-based applications (including DotNetNuke insallations) work from local database files, without having to run an instance of VS 2005 or VWD Express for each one.

Your post is a great starting point, for me, because it lists what to check to make sure that it all works rather than proposing one solution to a specific problem someone is experiencing.

I would be extremely grateful for any help you could offer me.

My best guess is that installing VS 2005 (Team Suite) + SQL Server 2005 messed things up - and some of the threads I've seen seem to be related to this combination.  I uninstalled SQL Server 2005, but it didn't make a big difference.

Thanks you very much, Ming.

Regards

Gary Bartlett
gb at prodsol dot co dot nz

Here is a list of threads I've looked at and tried in various combinations over the last few months:

http://forums.microsoft.com/msdn/showpost.aspx?postid=98346&siteid=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=441961&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=496500&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=521158&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=481696&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=125227&SiteID=1

http://www.sqljunkies.com/WebLog/ktegels/archive/2005/11/15/17401.aspx

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=455225&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=124596&SiteID=1
# September 23, 2006 5:06 AM

SQL Protocols said:

Hi, Gary

   From my understanding, you can try following to confirm:

1)

Without installing VS 2005 (Team Suite) + SQL Server 2005,

   http://localhost/SQLServerExpressTest/Default.aspx worked?

With installing VS 2005 (Team Suite) + SQL Server 2005,

http://localhost/SQLServerExpressTest/Default.aspx did not work?

Did you make any IIS configuration change before installing VS 2005(team suite) + SQL Server 2005?

2) Can you also try using osql /S.\SQLExpress /E from your client box to see whether connection to SQL Express breaked after intalling VS 2005 + SQL Server 2005? From the error, that seems to you established a connection, but later on some client operation failed. But this way can make sure from client app that not through IIS, do same data operation and if worked fine, that might nail down to something in your IIS deployment issue.

3) Also, you can open SQL Server profile to see when the error occured, which client operation happened?

I also post your question to SQL Express Forum(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=760610&SiteID=1&mode=1) and our SQL techinical disscussion alias trying to find out mor solution for your problem, I will post answer once I get feedback.

Good Luck!
Ming.

# September 25, 2006 3:21 PM

SQL Protocols said:

With shipping SQL Server 2005, we heard from customer feedback about suffering make successful remote...
# September 30, 2006 4:22 PM

SQL Protocols said:

With shipping SQL Server 2005, we heard from customer feedback about suffering make successful remote

# October 3, 2006 11:26 PM

firedog said:

all you need is:

CONN_STRING = "Server=.\\SQLEXPRESS;Initial Catalog=master;Integrated Security=SSPI";

You must allow Remote Connections too:

Start->Programs->Sql Server 2005->Configuration Tools->SQL Server Surface Area Configuration. Click "Surface Area Configuration for Services and Connections". Choose "Database Engine->Remote Connections", select "Local and Remote Connections", Apply, OK

# November 8, 2006 12:18 PM

Prets said:

Can we change the name of SQl server Express, at the time of installation, from default machine name to any other name. IS this Possible, please help it is very urgent.

# December 1, 2006 2:27 AM

SQL Protocols said:

By default, SQL Express was installed as a named instance, and the fixed instance name is "sqlexpress", hence when you make connection, you need specify" Data Source = <machinename>\sqlexpress" in your connection string.

# December 1, 2006 12:48 PM

Prets said:

Actually im trying to say, whether it is Possible to change <machinename> at time of installing Sql express. As apps made in sql server2K5 express, when they are distributed to clients we have to change the machine name in conn string. Is there any solution fr this.

# December 4, 2006 12:13 AM

adisciullo said:

I'm having a problem connecting with a Java application but I CAN connect using my .Net application - the user name and password are the same for both.  

The error I get is: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "CORNERS" requested by the login. The login failed. An interesing note - I get the same message if the database is not running.

SQL Server Express 2005 is installed in mixed mode.  

Here is my connection string in the .Net appplication: <add key="connectString" value="Server=(local);UID=sa;PWD=myPasswd;Database=CORNERS" />.  

These are my values in my Java app web.xml -

<init-param>

       <param-name>DBDriver</param-name>

       <param-value>com.microsoft.sqlserver.jdbc.SQLServerDriver</param-value>

</init-param>

<init-param>

       <param-name>DBURL</param-name>

       <param-value>jdbc:sqlserver://localhost\sqlexpress:1055;databaseName=CORNERS</param-value>

</init-param>

<init-param>

       <param-name>DBUser</param-name>

       <param-value>sa</param-value>

</init-param>

<init-param>

       <param-name>DBPwd</param-name>

       <param-value>myPasswd</param-value>

</init-param>.

And yes, the port is 1055 - I checked to find it.

I am using Microsoft SQL Server 2005 JDBC Driver 1.0 (sqljdbc_1.0.809.102).

Does anyone have any idea what is wrong so that the login fails in the Java application but works in the .Net application?

# December 8, 2006 3:26 PM

Il-Sung Lee said:

Hi adisciullo ,

I'm afraid that our team is not very familiar with the JDBC driver.  I suggest that you post your question on the SQL Server Data Access forum as members of our JDBC team normally monitor it for JDBC-related questions.

Il-Sung.

# December 8, 2006 5:08 PM

Mugunthan said:

Can you get a trace? Also, can you try our 1.1 driver? 1.1 driver has better tracing.

# December 10, 2006 3:06 AM

Low said:

Hi, I am having connection problem with SQL Server Express 2005. The problem occurs everyday after 6pm (after working hour). The error messenge is:

Microsoft SQL Server Login

--------------------------

Connection failed

SQLState 01000

SQL Server Error: 10060

[microsoft][ODBC SQL Server Driver]{TCP/IP Sockets]Connection Open (connect)

Connection failed

SQL State: 08001

SQL Server Error: 17

[microsoft][ODBC SQL Server Driver]{TCP/IP Sockets]SQL Server does not exist or access denied.

All computers which connect to the server will get this error messenge. I have been working on this for few days but without any luck. I would be grateful if someone could help. Thank you.

Note: The computers are working fine before 6pm.

# December 12, 2006 8:58 PM

Matt Neerincx said:

The error message indicates the client cannot open a socket to the sql server due to timeout.  10060 is socket error code for timeout.  To verify this you could use telnet and attempt to open a connection to port 1433 from some client machine ->

telnet 123.123.123.123 1433

where 123.123.123.123 is IP of SQL Server.

I would check all network hardware between clients and server, it would be a firewall or router or application level firewall blocking traffic most likely.

# December 13, 2006 5:08 PM

Junifer said:

Hello there,

I have a connection problem with sql server express but i believe you can help me with this.

First, I tried your Remote connection string above:

"Provider=SQLNCLI;Server=<MachineName>\SQLEXPRESS;Initial Catalog=master;Integrated Security=SSPI ";

and it works but somehow when i use my own database since your using the master, it ask for Login. Heres the error:

Microsoft SQL Native Client error '80004005'

Cannot open database <mydatabase> requested by the login. The login failed.

# December 22, 2006 12:23 PM

SQL Protocols said:

Hi, Junifer

   You need to grant dbaccess to your database for your login credential.

   1) Assume you were using NT login, windows authentication, you can use ManagementStudio, connect to sqlexpress, go to security, add login, choose the account, and choose default database = mydatabase.

   2) If you were using SQL login, you can go to security, found the account, click properties of it, then make sure it has access to your own database.

good luck!

Ming.

# December 22, 2006 5:00 PM

Junifer said:

Hey Ming,

Thank you for the reply, but before i receive your reply, i have it working already simply by openning the Management Studio Express, right click on mydatabase then properties. I click on Permission and under users or roles i added two objects guest and public then grant them few permission under Explicit Permission.

But i'm just wondering about security. Is my method safe/advisable?

I will also try your suggestion and i know it will work.

# December 23, 2006 12:26 AM

Tom Dorgan said:

Hi, good thread. I've got SQLExpress running on a n XP server and a client. I can connect to my DB instance no problem from the server by name(not localhost)using SQL Server Authentication. I get an error 10060 on the client using the same strings in Studio Express under Connect To Server on the client. I've tried a multitude of recommendations. If I try to telnet to the port that the ERRLOG says the service is running on from the server, it connects. If I try it from the client, it says 'Could not open connection to the host'. I'm not sure what to tweak to get this to go. Thanks.

# January 5, 2007 12:14 AM

Tom Dorgan said:

ahh....found it. check out the help screen under the TCP/IP properties screen under Protocols for SQLEXPRESS. short end is that if you are using a firewall you must use a static port. 1433 is recommended. This and all the rest of the above stuff. You also have to open the port in the windows firewall on both machines.

# January 5, 2007 12:32 AM

amit said:

On vista when i start application as an administrator it create/delete data but when i run app in standard user mode it does not perform any operation with sql express...

# January 12, 2007 2:47 AM

Joel said:

I've got a Windows 2003 Server, where we just installed SQL Server Express 2005 and IIS on the same machine.

Our application (classic ASP) errors with "Provider cannot be found. It may not be properly installed. " when trying to connect to the database with an anonymous connection (IUSR account).

Oddly, it connects successfully if we turn off anonymous users.

Any ideas?

# January 15, 2007 9:29 AM

SQL Protocols said:

Hi, Joel

   What if you turn on "anonymous" in IIS again, and try to use osql.exe to connec to your express, see whether the same error displayed. What if you turn off anoymous connection, use osql.exe, what happens? What is your connection string?

   The error you saw should not be related to anoymous users configuration but might there is exception.

Thanks!

Ming.

# January 16, 2007 1:17 AM

Joel said:

Hi Ming,

Here's the connection string that I was trying to use:

var connectionString = "Provider=SQLNCLI;Server=WEB01\\SQLEXPRESS;Database=<databasename>;UID=<username>;PWD=<pwd>;";

This one was failing for IUSR connections, though it seems to work okay on our other development machines.

This connection string seems to work okay:

var connectionString = "DRIVER={SQL Native Client};Server=WEB01\\SQLEXPRESS;Database=<databasename>;UID=<username>;PWD=<pwd>;";

What's technically the difference between these connection strings?  Any idea of why one would work for IUSR and the other would not?

# January 18, 2007 9:51 AM

SQL Protocols said:

Hi, JOel

   The first one is using OLEDB, the latter is using ODBC driver. So, from the error message, it was probably caused by your OLEDB provider was not correctly installed or you specify the wrong one.

1) Which client provider were you using, namely, when you create your client application, did you configure any provider? what it is?

2) what if you modify the first one by replacing "Provider =SQLOLEDB" whether it works?

LMK if you have further question.

Thanks!

Ming.

# January 22, 2007 1:18 AM

RJ said:

How can I access SQL Server from the internet ?

I have a router with a public IP

I have SQL Server 2005 Express installed on a LAN connected machine (192.168.1.64)

I want to access this database from the internet. How can I do ?

Firewall is already opened for the 1433 TCP Port

Thanks

# February 9, 2007 6:37 AM

SQL Protocols said:

Hi, RJ

   You can use ASP or write ASP.NET application. Following info and example are good start:

http://support.microsoft.com/kb/169377

http://samples.gotdotnet.com/quickstart/aspplus/doc/applications.aspx

Good Luck!

Ming.

# February 12, 2007 2:26 AM

Adrian said:

Hi Ming,

I also wish to connect to the SQLExpress through the Internet connection. However, not using ASP.Net but an .Net Windows Application.

I have a Static IP on the server and I supposed I can write connection string as normal remote connection over the LAN?

I attempted but failed to connect. My Server not running IIS, does it matter?

(We disregard firewall issue)

Thanks.

Adrian

# March 7, 2007 1:02 AM

John said:

hi there, im using vb 2005 and im tring to acess a data base on a server via pocket pc application.

i got an error on the connection string !

Failure to open SQL Server with given connect string. [ connect string = Provider=SQLOLEDB.1;Server=duros-mobile,1433\SQLEXPRESS;Initial Catalog=praia;Integrated Security=SSPI; ]

can  you help me?

thanks!

# March 12, 2007 12:12 PM

Sampath said:

I am trying to connect to a SQL Server DB from a pocket PC. I use the following connection string on the Pocket PC.

"Server=192.168.1.25,1433;Initial Catalog=exilog;User ID=nybc;Password=nybc"

I can connect to the server using the IP, port and credentials from SQL Server Management Studio Express. But when I run the application in the emulator, I get a "SQL Server does not exist or Access is Denied" SQL Exception.

This has been killing me for the past 5 days. Can someone please help me?

Cheers,

Sampath

# March 19, 2007 2:33 AM

SQL Protocols said:

Hi, John

   1433 is the reserved port for sql default instance, your express was installed as a named instance, and by default it is using dynamic tcp port unless you specified.

   The solution could be

[ connect string = Provider=SQLOLEDB.1;Server=duros-mobile\SQLEXPRESS;Initial Catalog=praia;Integrated Security=SSPI; ]

and make sure sqlbrowser service is started.

Good Luck!

Ming.

# March 19, 2007 12:58 PM

SQL Protocols said:

Hi, Sampath

   The error looks like you were using MDAC, and the message is too general to identify your particular problem. Hence, I suggest, you modified your connection string to [Driver={SQL Native Client};Server=192.168.1.25\sqlexpress;Initial Catalog=exilog;User ID=nybc;Password=nybc"

I assume you were connecting to sql express instance which is a named instance, and by default it is not using port 1433 which reserved by default instance, but a dynamic port. Or you can take a look at server errorlog to make sure your sql express was listening on tcp and find the port number, then replace 1433 in your connection string w/ the true number. Also, "Driver={SQL Native Client}" requires you must install SQL 2005 Native Client which is part of the 2K5 installation, this provider will populate more detail error info to help you figure out the root cause of connection failure.

Good Luck!

Ming.

# March 19, 2007 1:06 PM

SQL Protocols said:

This error was most frequently hitted by our customers, and in this post, give a brief summary of troubleshooting

# March 31, 2007 5:56 PM

badger said:

I am confused. I have 2 windows 2000 sp4 machines that I want to connect to a SQL Express database. Initially I had problems with both machines then I updated MDAC on them and now one of them connects and the other gets the following error:

Connection Failed:

SQLState: '01000'

SQL Server Error: 10061

[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen (Connect()).

Connection failed:

SQLState: '08001'

SQL Server Error: 17

[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL Server does not exist or access denied.

I know that everything is configured ok on the SQL Express machine as one of the win2000 machines can connect.

The only difference I can spot between the 2 machines is the version of the SQL ODBC driver. The one that works is 2000.85.1022.00 and the one that does not work is 2000.85.1064.00. I have no idea why they would have different drivers as the same version on MDAC was installed on both machines.

Any help is much appreciated.

# April 3, 2007 11:26 AM

Matt Neerincx (MSFT) said:

ConnectionOpen (Connect()) means you cannot open a socket to the remote SQL Server.  I don't think this is due to the MDAC driver version.  Most likely the tcp-ip port is blocked by Windows firewall and the "good" machine is actually connecting over named pipes and not sockets.  So if you go through the steps of adding the SQL Express instance to firewall exclusion list everything should work.  See this article for details ->

http://msdn2.microsoft.com/en-us/library/ms175043.aspx

# April 3, 2007 1:43 PM

badger said:

both machines are using TCP/IP

# April 4, 2007 3:43 AM

Matt Neerincx (MSFT) said:

Then they should both work the same in theory.  Could be issues such as IPsec blocking sockets.  IPSec typically blocks machines that are outside of a domain from connecting to machines that are inside a domain.

Simple way to verify is go to the SQL Express machine and find the ERRORLOG file for the SQL Express instance.  You can locate the ERRORLOG file by connecting to the SQL Express instance and running the following SQL statement:

select serverproperty('ERRORLOGFILENAME')

This will tell you the location of the error log file for the SQL Express instance.  Open this file in notepad and search for the following line:

2007-04-02 15:50:30.71 Server      Server is listening on [ 'any' <ipv4> 5555].

Once you know the port, then go to each client and try the following from a command prompt:

  telnet myServer 5555

If you see this go to a blank screen, then the port is open.  Press Ctrl + ] to break out of telnet.

# April 4, 2007 12:31 PM

vatsy said:

i hava .net application with database in Access

but when i run it it asks for sql server connection why

# April 26, 2007 10:13 AM

Adrian said:

Dear Ming,

Thanks for all the helpful comments - nevertheless I run into the following strange situation: I am writing a C# application in VS2005 which connects to a SQLEXPRESS database on a different server. I am using the following connection string: "Data Source=myServer\SQLEXPRESS;Initial Catalog=myDB;Integrated Security=True". When running it from the IDE (either Debug or Release mode), the connection works perfectly - however, when starting the application directly (double-clicking myApp.exe), the connection fails with "error: 26 - Error Locating Server/Instance Specified".

Do you have any idea?

Best regards, Adrian

# April 27, 2007 4:18 AM

毁于随 said:

最近遇到一个问题,就是同样的连接字符串,在PC上和在PocketPC上使用SqlClient连接SqlServer的数据库的时候,PC可以连上而PPC连不上.且PPC在连接的实例名为默认的实例名的时候...

# May 20, 2007 12:37 AM

Carl said:

Hi Ming,

I have a problem with a connection to database engine.  Evert time when I connect it, it always gives me this message:

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider)

For the server name, I put in <my servername>\<my instance>. I checked sqlbrowser and it's running. I changed the remote connection in database engine to local and remote conncection, but it still doesn't work.  

Please help me out.  Give me a solution to this problem. Thanks so much for your help.

# May 20, 2007 5:30 AM

MING LU said:

Hi, Carl

  1) What is the error message in server ERRORLOG? You can also see it from system application event log. If there is problem that indicate sql server terminate client connection, that means your client request has problem, and it is out of connectivity scope, you need to check your client application.

  2) Are you connecting Express? If so, please doublec check the instance name is "sqlexpress" in your connection string.If not, make sure you specifiy the correct instance name.

  3) Open SQL Server Configuration Manager, click client protocols, check whether TCP/NP protocols are allowed for remote connection?

  4) Look at your server ERRORLOG, see whether your sql instance is listening on the NP and TCP port.

  5) On your client machine,do "new view \\<remoteserver>" and "telnet <remoteserver> <tcpportthatserver listing on>" See whether that works?

Good Luck!

Ming.

# May 21, 2007 2:18 PM

Leslie said:

I am a fresher of SQLServer and just started with the Personal Web Site Starter Kit. The following error was showed in the explore:

=========================================

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

=========================================

And here is the log of SSEUtil.exe

=========================================

C:\>SSEUtil.exe -l

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

=========================================

I have confirmed both of the SQL Server(SQLEXPRESS) and the SQL Server Browser running well. Also, I can even creat a new project (whether a web site or a windows app) and connect to my testDB with the SQLDataSource component by "./sqlexpress" connection string.

What's the different of these two type of DB?

How can I get through the MS's example?

# May 23, 2007 4:17 AM

Neha said:

I have visual basic .net express and sql express.  I have created my db's so I know that I can use this instance.

I have enabled named pipes, remote connections, tcp/ip for both client protocols & protocols for sqlserverexpress.

I have done everything that is listed on this forum to try and resolve my connectivity issues.

I cannot connect from my webapp locally to my instance.  I get the generic error: "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) "

I see no errors in the error log.  I have made sure my connection string says computername\sqlexpress.

i can put anything in it and I still get the same error.

I am going out of my mind.  Please help.

# June 8, 2007 10:52 PM

Meenal said:

Hi all

I am having two applications which are using same database.I have upgraded databse from sql server 2000 to 2005 on xp.one application is in vb6.0 which is connecting with the database but the application in asp is giving error as

"Microsoft SQL Native Client (0x80004005)

Cannot open database "HVSP" requested by the login. The login failed.

/NewVspSql/logon.asp, line 41"

My connection string for vb6.0 application is as follows

"Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;User ID=HVSP;Password=;Initial Catalog=HVSP;Data Source=INFO15\SQLEXPRESS"

# July 11, 2007 7:25 AM

SQL Protocols said:

Meenal

    Please refer the following blog to check out what is potential cause of the 'Login Failed'.

http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx

Good Luck!

Ming.

# July 11, 2007 12:29 PM

SQL Protocols said:

Meenal

    Please refer the following blog to check out what is potential cause of the 'Login Failed'.

http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx

Good Luck!

Ming.

# July 11, 2007 12:29 PM

SQL Protocols said:

Meenal

    Please refer the following blog to check out what is potential cause of the 'Login Failed'.

http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx

Good Luck!

Ming.

# July 11, 2007 12:29 PM

Myles said:

Ming,

I have a Vista customer with an odd problem. If his router is on he does not get a connection to the SQL database or gets one so slow that it is unusable. If he turns off the router it works right. If he turns on the router after making a sucessful connection it works right. I am presuming that this a connection timeout problem and we will try a longer setting there. My question to you is what SQL 2005 is doing that conflicts with the router? He is running the application and the SQL Express database on a single machine and it is the only machine connected to the router. In trying to fix this we have added sqlservr, sqlbrowser and port 1433 to the firewall exceptions and set scope to his subnet only. The router manufacturer say the router should not be doing anything to calls limited to the subnet. TIA for any ideas you have on this problem.

# August 15, 2007 7:39 PM

Joe said:

Hi,

I have this issue with the connectivity (timeout expired) in my .asp code.

Microsoft OLE DB Provider for SQL Server error '80004005' Timeout expired

/SQLDB/resultpage.asp, line 49

The connection string is:

set conn = Server.CreateObject("ADODB.Connection")

conn.open "Provider=SQLOLEDB;Data Source=ServerName;Initial Catalog=DBName;UID=sa;PWD=password"

Environment:

1. MS Windows Server 2003, running SQL Server 2005 SP1, DHCP

2. MS Windows 2000 Server SP4, hosting IIS, connection type = TCP-IP

Tried few links, but it does not seem to work.

Anyone can help?

# September 17, 2007 4:47 AM

greg said:

is it possible to interactively query SQLBROWSER (via command line interface) to retrieve the list of sql servers broadcasting their existence?  i am not a win32 programmer and do not have a win32 development environment.  my only programming experience is with platform neutral perl.  any help would be appreciated.  net start indicates that i have the sqlbrowser service running.  control panels - admin tools - services - also shows that it is running.  but i dont know if a command line interface is available...  or might someone have a small stand alone executable that i can use for this purpose?

# September 17, 2007 4:40 PM

greg said:

vista stand alone computer.  sqlexpress default installation (shared memory enabled).  having trouble connecting.  error is '[dbnetlib open] sql server does not exist or access denied'.

this error seems to be a bit contradictory to me.  information ive read about sqlexpress states that 'dbnetlib' is only to be used for tcp\ip connectivity to sqlexpress server.  not for shared memory.

if sqlexpress is installed locally, and client is also local, and sqlexpress is configured to use shared memory for connectivity - why would dbnetlib be utilized at all?  is my connect string not ideally configured to use shared memory?

my connect string presently looks like;

Provider=SQLOLEDB.1;

Integrated Security=SSPI;

Initial Catalog=MYDB;

Use Encryption for Data=False

i dont know how to step by step troubleshoot a shared memory connection.

# September 17, 2007 7:13 PM

BINGO-WINGS said:

I had the following error when connecting ODBC to sqlserver on a different machine "does not exist or access is denied".

After reading loads of posts and trying this, that and the other for weekades I came up with what worked for me (Phew!), it might work for you.

In "Local Users and Groups" I added myself (power user) to the "SQLServer2005MSSQLServerADHelperUser$INSTANCE",

"SQLServer2005MSSQLUser$SERVER$INSTANCE" and

"SQLServer2005SQLBrowserUser$SERVER" groups.

BINGO

IS

HIS NAME-O

Obviously obvious from the error message isn't it just.....

HTHUMF

# October 3, 2007 9:32 AM

Eusebiu said:

I think I got a solution...

the error is in the connection string and in the configuration... if you'll use the IP instead of (loca), localhost, <machinename>\SQLEXPRESS, it will work. So use 127.0.0.1... the server will love it... and one more thing... at Protocols (SQL Server Configuration) at TCP/IP, set at IPAll - TCP Dymanic ports 1433 and one more... of course... set trusted connection to true... (you should allow remote connections too)..

So, the connection string is :

"Provider=SQLNCLI;Server=127.0.0.1;Database=database;Trusted_Connection=yes;"

Hope this helps someone..

P.S. : from my point of view.. I think this solution is a stupid one as long as local = localhost = 127.0.0.1... I guess for the SQLExpress.... local = localhost != 127.0.0.1

# October 18, 2007 5:09 PM

Hax Or said:

I do not get the error "cannot find odbc" when I run my ASP.NET website with debugging (using the service on a random port #).

But when I try the site using http://localhost/websitename/index.aspx  it says it cannot find the ODBC connection.

Must be something to do with my IIS config... can't find anything that pertains to this however..

# October 22, 2007 4:37 PM

svrk said:

Hi I have problem in connecting sql express sp2 in vista.

the error is 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)

I have done:enabling tcp/ip and named pipeline for sql server.

please help me out.

# November 15, 2007 2:18 PM

Sougandh said:

Hi There,

I have been going around in circles with this problem.  Can you please throw some light on why we keep getting this error.

I am using the following connection string.

===============================================

Source=.\SQLEXPRESS;AttachDbFilename=C:\PROGRAM FILES\ATHLETIC GATEWAY AS\OLYMPIATOPPENS TRENINGSDAGBOK V2.0\DATA\OLTDDB.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True

===============================================

And i keep getting this error almost all the time.

===============================================

Message: Cannot open user default database. Login failed.

Login failed for user 'PLAIN06\adminuser'.

===============================================

One reason for this is that, we have two applications accessing the DB.  One is a [WEB] based application [Running on Cassini Web server].  The other one is a [WINDOWS] based application.

I verified my code to check for any connections that might have been left open after a open connection call.  But all open connection call is properly followed by a close connection call.  I hope i am right in understand this that the connections are closed once opened using a close connection component method call.  Or does it take time for a closure of the same like in case of any connection pooling.

Specific to my case, i have to run the [Windows] based application before running the [WEB] application.  The Windows application does a synchronization process first.

Again for resynchronization i have to close the [WEB] application and also close the Cassini web server process physically to once again allow my [Windows] based application to connect to the db.

I agree that considering the nature of SQL Server User Instance i will be able to have a single user connect to the database at any given point in time.  However having said this is there a way to verify if there is any open connection to this database from my .net code.

If so please let me know of the same.

Thanks & Regards

Sougandh Pavithran

# November 19, 2007 7:27 AM

klira said:

<a href= http://index1.rutyqe.com >tallulah river campground</a>

# December 12, 2007 2:38 AM

99999 said:

Stdimmen dadrin übersein, dasss untear Bersücksichtigung dser Art der SQaL Sserver-Instanaz i Usaer in daer Lasge, einsen einzigen Benutzer die Verbindsung zur Datsenbank zu einem beliebigen Punkt in der Zeit. Allerdings haben gesagt, diese gibt es auch einen Weg um zu prüfen, ob es eine offene Verbindung zu dieser Datenbank aus meiner. Net-Code

# December 15, 2007 9:27 AM

777554 said:

Ddieses Versagefn verurssacht wersden köannen, durch die Tatsache, dass im Rahmen der Standard-SQL-Server-Einstellungen ist es nicht möglich, Remote-Verbindungen. (Provider: Named Pipes Provider, error: 40 - konnte nicht geöffnet werden eine Verbindung zu SQL-Server)

Icah habde getdan: Sfo ködnnen dide TCdP / IdP und den Namend für sdie SQL Servers-Piapeline

# December 15, 2007 9:29 AM

666557 said:

Sqdlexdpress lodkal instdalliert idst, undd der Kundde isdt audch vord Odrt, udnd sqlexpresss so konfidguriert ist, verwenden desn gemeinsamen Speicher für die Konnektivität - warum sollte dbnetlib auf allen genutzt werden? String ist meine Verbindung nicht optimal konfiguriert, um mit gemeinsam genutzten

# December 15, 2007 9:30 AM

Rizwan said:

Hi I have problem in connecting sql Server in vista.

i was develop a desktop application on visual studio. Setup contains Sqlserver and dotnet framework . Its works fine when i was deploy on Xp. but it did not work on vista and throwing exception that is given below.

the error is 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)

please help me out.

# June 20, 2008 1:38 AM

Uday said:

hey

my database name is gssportal\sqlexpress

but i'm unable to connect from my tomcat. It is giving Login failed for user .. Even i chaged my database to Mixed Mode(Windows as well as SQL Authentication)

please help me.

# June 20, 2008 3:21 AM

uday said:

Hey

i configured my data base in tomcat in this way

<ResourceParams name="MSSQL">

   <parameter>

     <name>url</name>

   <value>jdbc:sqlserver://gssportal\sqlexpress:1433;DatabaseName=webexpenses3

</value>

   </parameter>

   <parameter>

     <name>password</name>

     <value>sql@gss</value>

   </parameter>

   <parameter>

     <name>maxActive</name>

     <value>4</value>

   </parameter>

   <parameter>

     <name>maxWait</name>

     <value>5000</value>

   </parameter>

   <parameter>

     <name>driverClassName</name>

     <value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>

   </parameter>

   <parameter>

     <name>username</name>

     <value>sa</value>

   </parameter>

   <parameter>

     <name>maxIdle</name>

     <value>2</value>

   </parameter>

 </ResourceParams>

I'm able to login from sql server management studio

but when i try to connect form tomcat it is giving this error

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFact

ory (Login failed for user 'sa'.)

       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou

rce.java:855)

       at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource

.java:540)

       at com.gssamerica.expensereporting.ui.common.SQLManager.getConnection(SQ

LManager.java:95)

       at com.gssamerica.expensereporting.business.dao.CacheHome.getExpenseIds(

CacheHome.java:46)

       at com.gssamerica.expensereporting.business.listener.LookupCacheListener

.cacheExpenseId(LookupCacheListener.java:183)

       at com.gssamerica.expensereporting.business.listener.LookupCacheListener

.contextInitialized(LookupCacheListener.java:55)

       at org.apache.catalina.core.StandardContext.listenerStart(StandardContex

t.java:3827)

       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4

343)

       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase

.java:823)

       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:80

7)

       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

       at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDe

ployer.java:903)

       at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)

       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

       at java.lang.reflect.Method.invoke(Method.java:585)

       at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.jav

a:216)

       at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)

       at org.apache.commons.digester.Rule.end(Rule.java:276)

       at org.apache.commons.digester.Digester.endElement(Digester.java:1058)

       at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester

.java:76)

       at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source

)

       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(

Unknown Source)

       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent

Dispatcher.dispatch(Unknown Source)

       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un

known Source)

       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

       at org.apache.commons.digester.Digester.parse(Digester.java:1567)

       at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep

loyer.java:488)

       at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)

       at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.j

ava:483)

       at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427

)

       at org.apache.catalina.startup.HostConfig.checkContextLastModified(HostC

onfig.java:800)

       at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1085)

       at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java

:327)

       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl

eSupport.java:119)

       at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.

java:800)

       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p

rocessChildren(ContainerBase.java:1619)

       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.p

rocessChildren(ContainerBase.java:1628)

       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.r

un(ContainerBase.java:1608)

       at java.lang.Thread.run(Thread.java:595)

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for use

r 'sa'.

       at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError

(Unknown Source)

       at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(Unknown Source)

       at com.microsoft.sqlserver.jdbc.TDSParser.parse(Unknown Source)

       at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown So

urce)

       at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source

)

       at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(Unknown S

ource)

       at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecu

te(Unknown Source)

       at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)

       at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unkno

wn Source)

       at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknow

n Source)

       at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover

(Unknown Source)

       at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Sour

ce)

       at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)

       at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Driv

erConnectionFactory.java:37)

       at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolable

ConnectionFactory.java:290)

       at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas

icDataSource.java:877)

       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou

rce.java:851)

       ... 41 more

Jun 20, 2008 12:43:10 PM org.hibernate.util.JDBCExceptionReporter logExceptions

WARNING: SQL Error: 0, SQLState: null

Jun 20, 2008 12:43:10 PM org.hibernate.util.JDBCExceptionReporter logExceptions

SEVERE: Cannot create PoolableConnectionFactory (Login failed for user 'sa'.)

Jun 20, 2008 12:43:10 PM com.gssamerica.expensereporting.business.dao.StatusHome

StatusList

SEVERE: find by example failed

org.hibernate.exception.GenericJDBCException: Cannot open connection

       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException

(SQLStateConverter.java:103)

       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j

ava:91)

       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp

er.java:43)

       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp

er.java:29)

       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager

.java:420)

# June 20, 2008 3:25 AM

binyam said:

Installed SQL express 2005 [ SQLEXPR_ADV ].

Operating system vista.

I couldn't create locally a connection under object explorer.

The following error pops up :

TITLE: Connect to Server

------------------------------

Cannot connect to BINYAM-PC\SQLEXPRESS.

------------------------------

ADDITIONAL INFORMATION:

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476

------------------------------

BUTTONS:

OK

------------------------------

# July 5, 2008 5:07 PM

binyam said:

Installed SQL express 2005 [ SQLEXPR_ADV ].

Operating system vista.

I couldn't create locally a connection under object explorer.

The following error pops up :

TITLE: Connect to Server

------------------------------

Cannot connect to BINYAM-PC\SQLEXPRESS.

------------------------------

ADDITIONAL INFORMATION:

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476

------------------------------

BUTTONS:

OK

------------------------------

# July 5, 2008 5:08 PM

Terry Friesen said:

Help Help

I have been successfully running a connnection to my sql server express 2005 from several computers on our local network. However I am having problems now with two pc's after I changed the windows user account name and password. This is probably a simple fix, but where can I fix this. Do I need to accordingly setup/change a windows user account on the server? Any advice is much appreciated!

# July 11, 2008 3:23 PM

Terry Friesen said:

I should clarify that it is the username on the 2 client pc's that have been changed, which seemed to cause a problem logging on to SQL on the server.

# July 11, 2008 7:53 PM

matar_mr said:

<a href= http://index4.diolas.com >movie ticket graphic</a> <a href= http://index1.diolas.com >girls caught on camera</a> <a href= http://index2.diolas.com >massey ferguson 8150</a> <a href= http://index3.diolas.com >french country bedroom picture design in massachusetts</a> <a href= http://index5.diolas.com >columbine- cassie</a>

# July 13, 2008 12:00 AM

Pollus said:

This is for your information. If you want to understand the dynamic allocated port on SQL Server. This KB article is pretty good. So when SQL Server allocate a port you can almost be sure it stay that port until you change it manually.

# July 30, 2008 12:57 PM

Saurav said:

localhost\SQLEXPRESS

gives Unrecognized Escape Sequence

# December 22, 2008 2:10 PM

Matt Neerincx (MSFT) said:

Perhaps you are using C# and not using @ string prefix, then try:

localhost\\SQLExpress

Or you can use @ prefix on connection string, then you do not need to escape backslash:

@"Server=localhost\SQLExpress;..."

# December 22, 2008 3:23 PM

j2yemi said:

I am almost getting frustrated please help me.

I need to establish a connection to the sqlexpress on my system from my visual c#. I am programming a smart device using visual studio 2005.

I did the following

I enabled remote connections from the surface area config for tcp and named pipes

I started the browser

I could connect from MS visual studio

The server is up and running

but when i tried to connect from visual studio using the code

using System;

using System.Collections.Generic;

using System.Text;

using System.Data.SqlClient;

using System.Windows.Forms;

using System.IO;

using System.Reflection;

using System.Data;

namespace mQAQI

{

   class sqlDatabaseUtil

   {

       SqlConnection dataConnection = new SqlConnection();

       public void getConnection()

       {

           try

           {

               String connString = "Data Source=abudawe\\sqlexpress;Initial Catalog=mQAQI;Integrated Security=True";

               //String connString = "Data Source=xx.sdf";

               dataConnection.ConnectionString = connString;

               dataConnection.Open();

               MessageBox.Show("Connected to database successfully.");

            }

            catch (FileNotFoundException fe)

            {

                MessageBox.Show(fe.StackTrace + "Error Accessing the database.");

                MessageBox.Show(fe.Message);

            }

            catch (SqlException sqle)

            {

                MessageBox.Show(sqle.StackTrace + "Error Accessing the database.");

                MessageBox.Show(sqle.Message);                

            }

            catch (IOException io)

            {

                MessageBox.Show(io.StackTrace + "Error Accessing the database.");

                MessageBox.Show(io.Message);

            }

          /* catch (Exception e)

           {

               MessageBox.Show(e.StackTrace + "Error Accessing the database.");

               Console.WriteLine(e.StackTrace);

           }*/

           finally

           {

               dataConnection.Close();

           }

       }

   }

}

I get the following message

"specified server not found: abudawe\sqlexpress"

Please what am i doing wrong. I have battled with this issue for the past 4 days

Thanks

# January 12, 2009 1:41 PM

weight loss _ said:

the error is 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)

# May 3, 2009 9:55 AM

Kelly said:

I repeatedly get the message "Microsoft SQL Server 2005 was unable to install on your computer." I uninstall the and reinstall SQL and FFI software and same message.

Error signature

EventType: sql90setup P1: unknown P2: 0x643 P3: unknown P4: 0x643 P5: unknown P6: unknown P7: msxm16.msi@6.20.1099.0

Error Report Contents

c:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\SqlSetup0002.cab

What do I do?

# May 22, 2009 6:54 PM

Hi said:

I am using Sql server 2005 express with my app writen in vb6.

I have a problem that after a day of work

(when I come in the morning ) the app is working very slow.

So when I am opening the sql managment tool or restarting the sql service

everything is back to noraml.

i was to trying to configure the database to auto close = false

and also auto shrink is off.

Please see i you can help...

Thanks in advance

Alon

# June 7, 2009 4:53 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker