Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 Problems attching a MSDE DATABASE

Author  Topic 

rythm123us
Starting Member

27 Posts

Posted - 2006-03-28 : 15:02:23
TITLE: Locate Database Files - SHAH\SQLEXPRESS
------------------------------

C:\Documents and Settings\Pranav\My Documents\Visual Studio Projects\Solution Projects\POS\Data
Cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists.

If you know that the service account can access a specific file, type in the full path for the file in the File Name control in the Locate dialog box.

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

This is the error I see when I try to attach a file sitting in this folder. I have been able too attach other Databases at other locations. Basically, I cannot access files sitting under "C:\Documents and Settings\Pranav". "Pranav" is my user name and I am an administrator on my local computer. I am not sure what settings need to be changed. I made sure that my folder is not Private. I was able to attach files under this location on a different computer with MSDE.

Any help will be great.

--Thanks

mikewa
Microsoft SQL Server Product Team

84 Posts

Posted - 2006-03-28 : 16:41:12
You need to check the Service Account that you are using to run MSDE and ensure that that account has access to the folder. Look in the Services list for your MSDE instances and then open the properties to determine the Service Account. Once you have that, verify that the directory access is setup for that account.

Regards,
Mike Wachal
SQL Express

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Go to Top of Page

rythm123us
Starting Member

27 Posts

Posted - 2006-03-30 : 09:59:38
I do not have the machine with MSDE installed anymore. So I don't know what the settings were. The SQL Express seems to run under account "NT AUTHORITY\NetworkService". However I do not see this account under Control Panel -> User Accounts, or should I just change the user for SQL Express.

--Thanks
Go to Top of Page

mikewa
Microsoft SQL Server Product Team

84 Posts

Posted - 2006-04-05 : 12:50:51
OK, from the title I had assumed you were using MSDE.

The issue is that Network Service doesn't have access to the My Documents directory so SQL Express can not access the database file you're pointing to. Network Service is the default service account for SQL Express. There are a couple ways to address this:

1. Use User Instances which spawn a special instance of SQL Express in the context of the logged on user. The User Instance will have access to your My Documents folder since it runs as you. If this is a single user applicatin, this is probably the way to go. Check out the white paper about User Instances at http://msdn.microsoft.com/sql/express/default.aspx?pull=/library/en-us/dnsse/html/sqlexpuserinst.asp.
2. Move the database to a directory that SQL Express does have access to, such as the Data directory for your SQL Express installation. If you're using SQL Express more like a server for a multi-user application, this would be the recomended way to go.
3. Run SQL Express as a different user account that has permissions to the location where you want to store your databases. Doing this gives SQL Express all the permissions of the service account, if you run Express under your login account, and your an Administrator, then SQL is an Administrator and can do anything, say like running stored procedures that delete your Windows directory.
4. Give the Network Service account access to your My Documents directory. This isn't really recomended for the same reasons as #3.


Regards,
Mike Wachal
SQL Express

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Go to Top of Page

sheela
Starting Member

1 Post

Posted - 2012-03-05 : 07:26:57
Issue has been resolved with below steps:

Go to SQL services > Properties > Logon > Here you have to check mark on Local System account > Click on Allow service to interact with Desktop

Have a gr8 Day ahead


Sheela Chauhan
Sr. Server Admin Windows Group
Go to Top of Page
   

- Advertisement -