Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Issue with SQL Express 2008 autoattach feature
detlevv
#1 Posted : Thursday, February 28, 2013 10:26:13 AM(UTC)
Groups: Member
Joined: 2/26/2013(UTC)
Posts: 7

Was thanked: 1 time(s) in 1 post(s)
We intent to use SQL Server Express 2008 in conjunction with Ultidev Webserver to distribute locally installable versions of a web application. We have set up a connection to a local database file. Anything runs fine, if a guy with admin priviledges sits in front of the computer and runs the app from Visual Stuido 2010 debugger. So far, so nice.

If the projekt is compiled and packed, then locally installed on the same machine and the same guy tries to run the app, an error appears while attaching the MDF to SQL Express instance (pls. apologize for german error text):

Die CREATE DATABASE-Berechtigung wurde in der 'master'-Date!!! counterfeit illegal fraudulent low-quality spam !!!nk verweigert

The connection string used is as follows ('.\project.mdf' is programmatically expanded to full qualified path name)

connectionString="Data Source=(local)\SQLEXPRESS; AttachDBFilename=.\project.mdf; Initial Catalog=Project; Integrated Security=true;"

I guess, that the error results from the different security context, the webserver runs in. Now, I'm a bit confused, how to enable the web server to attach my database file to SQL Express instance.

Any ideas are welcome.

-detlevv
Ultidev Team
#2 Posted : Thursday, February 28, 2013 2:04:30 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

This problem is now UWS-specific and in general described here.

First, please be sure to place your database in the App_Data folder - UWS has more relaxed access rights for it. If that doesn't help, here are other possible solutions:

  • UWS processes, that host ASP.NET applications, run under either as a restricted "NETWORK SERVICE" account (default setting) or "LOCAL SYSTEM" account, which is almost an administrator level. If you switch your application registration to "LOCAL SYSTEM", this problem is likely to go away, but doing so makes your application more vulnerable to hacking and take over.

  • Better option would be for your installer, which is likely to run as administrator, to attach the database during installation, and then your application would just connect to the database w/o attempting to attach or do other high-privilege things.


Please let us know if this information was helpful.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.