curiouswebster
asked on
Cannot open database requested by the login.
I get an exception when I open an SQL Express database from a web service, yet the exact connection string works in my primary Windows program.
Here's the string:
@PROVIDER=SQLOLEDB;Initial Catalog=ODBCsubsystem;Data Source=BOBHP\SQLEXPESS;Int egrated Security=SSPI;
Here's the error:
Cannot open database ODBCsubsystem requested by the login. The login failed.
Any idea why this might be?
thanks,
newbieweb
Here's the string:
@PROVIDER=SQLOLEDB;Initial
Here's the error:
Cannot open database ODBCsubsystem requested by the login. The login failed.
Any idea why this might be?
thanks,
newbieweb
1. Hosting on Windows XP will limit you to 5 concurrent connections to the XP machine. XP is not an OS designed for production server software.
2. Hosting on Windows XP will limit you to IIS 5x - you should be using IIS to allow you to configure application pools.
3. Your connection string is set to connect with Windows Authentication. You *either* need to configure your web.config for impersonation *or* connect with a SQL login to the database (and then you need to ensure that SQL is running in Mixed Authentication mode).
2. Hosting on Windows XP will limit you to IIS 5x - you should be using IIS to allow you to configure application pools.
3. Your connection string is set to connect with Windows Authentication. You *either* need to configure your web.config for impersonation *or* connect with a SQL login to the database (and then you need to ensure that SQL is running in Mixed Authentication mode).
ASKER
Hi,
1. What constitutes a concurrent connection? Are you saying I might be near or above my limit?
2. I was planning on having two applications accessing my SQL Express 2005 database, that's all. One is the web service and one is my Windows program.
3. Which method is better? I did install SQL Express with Mixed Authentication so I would have the choice. SO now I just need to add a usermname/pasword pair and put that into my connection string? Right?
Could you blast me my connection string with username and password specifiers?
thanks,
newbieweb
1. What constitutes a concurrent connection? Are you saying I might be near or above my limit?
2. I was planning on having two applications accessing my SQL Express 2005 database, that's all. One is the web service and one is my Windows program.
3. Which method is better? I did install SQL Express with Mixed Authentication so I would have the choice. SO now I just need to add a usermname/pasword pair and put that into my connection string? Right?
Could you blast me my connection string with username and password specifiers?
thanks,
newbieweb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
1. As far as scalability, I intend to use the web service for one restaurant only, via its intranet. I have no plans to scale its use beyond that.
2. What kind of bottleneck do you mean? The web service will be getting new orders submitted from the restaurant's POS as many as a few per minute and as little as a few per hour. The POS will need to poll my web service every 15 seconds checking the status of certain things. Each access wil need a database query or update. Might this caue a bottleneck?
3. I'd like Windows Authentication if it's safer, if I can have it. Am I able to now that I installed it with mixed mode?
2. What kind of bottleneck do you mean? The web service will be getting new orders submitted from the restaurant's POS as many as a few per minute and as little as a few per hour. The POS will need to poll my web service every 15 seconds checking the status of certain things. Each access wil need a database query or update. Might this caue a bottleneck?
3. I'd like Windows Authentication if it's safer, if I can have it. Am I able to now that I installed it with mixed mode?
ASKER
which connection string is the right one for WA?
If you are creating user instances of SQL Server Express, the error your getting is most likely is most likely caused by a failure of the user database to attach when the instance starts. What is the service account you are using for SQL Server Express? If you are not using the Network Service account, try using it instead.
ASKER
I have no idea what a Network Service Account is. Can you tell me how to find out?
Open you SQL Server Configuration Manager and right click on the SQL Server Express service. It is listed as one of the Built-in accounts on the Log in tab.
ASKER
It says "Network Service"
Your first connection string uses Windows Authentication. Note though that unless you use impersonation in the web.config (to impersonate a domain account), the web application will attempt to connect as a user local to the web server, and this will fail.
As for the bottleneck, this is in the amount of concurrent connections to IIS. If you never plan on having more than one, this will not be a problem.
As for the bottleneck, this is in the amount of concurrent connections to IIS. If you never plan on having more than one, this will not be a problem.
ASKER
Nightman,
Thanks.
How do I use impersonation to solve this?
newbieweb
Thanks.
How do I use impersonation to solve this?
newbieweb
Have a look here:
http://www.aspdev.org/articles/web.config/
It shows you the different permutations you can use in the config for impersonation.
http://www.aspdev.org/articles/web.config/
It shows you the different permutations you can use in the config for impersonation.
ASKER
So would I just include this line in web.config?
<identity impersonate="true|false" userName="username" password="password"/>
and would the username and pasword be the same ones I use to log onto my Windows account?
<identity impersonate="true|false" userName="username" password="password"/>
and would the username and pasword be the same ones I use to log onto my Windows account?
ASKER
It seems to be working.
Thanks.
Thanks.
Yes, that's pretty much. You may have to change the web site settings (I need to check, but I think anonymous access must be enabled, as well as integrated windows authentication).
Pretty much all of this should be in the MSDN documentation as well.
Pretty much all of this should be in the MSDN documentation as well.
:)
It's a pleasure. Good luck with your project.
It's a pleasure. Good luck with your project.
ASKER
Is there any problem with this strategy?