Unable to open the physical file. Operating system error 5: "5(Access is denied.)". A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
RSS
Unable to open the physical file "G:\Personal Site Kit\App_Data\personal.mdf". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file G:\Personal Site Kit\App_Data\personal.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Unable to open the physical file "G:\Personal Site Kit\App_Data\personal.mdf". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file G:\Personal Site Kit\App_Data\personal.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Source Error:
Line 153: Public Shared Function GetOnlineUsersCount() As String
Line 154: Dim objUser As MembershipUser
Line 155: Dim objUserCollection As MembershipUserCollection = Membership.GetAllUsers()
Line 156: Dim objUsers As New MembershipUserCollection
Line 157:
Source File: G:\Personal Site Kit\App_Code\UserManager.vb Line: 155
Stack Trace:
[SqlException (0x80131904): Unable to open the physical file "G:\Personal Site Kit\App_Data\personal.mdf". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file G:\Personal Site Kit\App_Data\personal.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734979
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
System.Web.Security.SqlMembershipProvider.GetAllUsers(Int32 pageIndex, Int32 pageSize, Int32& totalRecords) +1658
System.Web.Security.Membership.GetAllUsers(Int32 pageIndex, Int32 pageSize, Int32& totalRecords) +65
System.Web.Security.Membership.GetAllUsers() +26
UserManager.GetOnlineUsersCount() in G:\Personal Site Kit\App_Code\UserManager.vb:155
Default_aspx.Page_PreRender(Object sender, EventArgs e) in G:\Personal Site Kit\Default.aspx.vb:88
System.Web.UI.Control.OnPreRender(EventArgs e) +2066956
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
I am only guessing but It looks like there is a database called personal that is already attached to the database engine or you need to give file permissions tothe app_data folder to the NETWORK SERVICES acccount.
Hope this helps
Please mark the most helpful post(s) as Answer Blog | I need more space:DropBox Referral
It appears this may be on an IIS box, in which case I would look at share and ntfs permissions. Make sure you look at inheritence on the NTFS side as well.
Rajesh - Jes...
Member
25 Points
5 Posts
Unable to open the physical file. Operating system error 5: "5(Access is denied.)". A database wi...
Oct 21, 2006 10:49 AM|LINK
Server Error in '/PS' Application.
The '/PS' is virtual directory of Local Host.
Unable to open the physical file "G:\Personal Site Kit\App_Data\personal.mdf". Operating system error 5: "5(Access is denied.)".
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.An attempt to attach an auto-named database for file G:\Personal Site Kit\App_Data\personal.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Exception Details: System.Data.SqlClient.SqlException: Unable to open the physical file "G:\Personal Site Kit\App_Data\personal.mdf". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file G:\Personal Site Kit\App_Data\personal.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Source Error:
Source File: G:\Personal Site Kit\App_Code\UserManager.vb Line: 155
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
whighfield
Star
11721 Points
1859 Posts
Re: Unable to open the physical file. Operating system error 5: "5(Access is denied.)". A databas...
Oct 21, 2006 10:07 PM|LINK
I am only guessing but It looks like there is a database called personal that is already attached to the database engine or you need to give file permissions tothe app_data folder to the NETWORK SERVICES acccount.
Hope this helps
Blog | I need more space:DropBox Referral
rhhanson63
Member
354 Points
76 Posts
Re: Unable to open the physical file. Operating system error 5: "5(Access is denied.)". A databas...
Oct 23, 2006 04:38 PM|LINK
It appears this may be on an IIS box, in which case I would look at share and ntfs permissions. Make sure you look at inheritence on the NTFS side as well.
Bob