Results 1 to 7 of 7

Thread: [RESOLVED] Webform error - "It is already opened exclusively by another user, or you need (..)"?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    8

    Resolved [RESOLVED] Webform error - "It is already opened exclusively by another user, or you need (..)"?

    Basically, I am using VB.Net to generate an asp.net webform. The form will be a front end control for an access database. But apparently I am having some problems with it. Here's what I did.

    1. I added the access database to my project by clicking "Connect Database" button in the server explorer.
    2. As a provider I chose Microsoft Jet 4.0 OLE DB Provider, and I pointed it to the right db file. What baffled me here (on the Connection tab) that I was asking me for a User Name (the default there is "Admin") - what should I put there? Testing Connection works just fine.

    3. Under the "Advanced" tab, in Access Permissions I choose "ReadWrite", and click OK - everything seems to be fine.
    4. I'm trying to set up my database connections by dragging a table name from the server explorer onto my form. When I do that a window asking me if "I want to include the password in the connection string?". I can either include the password or not. No matter what I chose my dbConnection and dbAdapters are created.

    5. I right click on my Adapter to create a new dataset. Then after configuring it, I try to fill my dataset during my Page_Load event by using "OleDbDataAdapter1.Fill(mydataset)" code

    After I run the program I get the error that I copy and pasted below. Could you tell me what I'm doing wrong? Do I need to set up some permissions somewhere? How do I do that? Is there something that I need to do in my IIS settings?

    Thanks for your help!!



    ===============================================
    Server Error in '/Calendar1' Application.
    The Microsoft Jet database engine cannot open the file 'C:\Inetpub\wwwroot\Calendar1\calendar.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
    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.OleDb.OleDbException: The Microsoft Jet database engine cannot open the file 'C:\Inetpub\wwwroot\Calendar1\calendar.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

    Source Error:

    Line 157: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Line 158: 'Put user code to initialize the page here
    Line 159: OleDbDataAdapter1.Fill(DsVerify1)
    Line 160: End Sub
    Line 161:


    Source File: c:\inetpub\wwwroot\Calendar1\WebForm1.aspx.vb Line: 159

    Stack Trace:

    [OleDbException (0x80004005): The Microsoft Jet database engine cannot open the file 'C:\Inetpub\wwwroot\Calendar1\calendar.mdb'. It is already opened exclusively by another user, or you need permission to view its data.]
    System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1054689
    System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +53
    System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
    System.Data.OleDb.OleDbConnection.Open() +37
    System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +86
    Calendar1.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\Calendar1\WebForm1.aspx.vb:159
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +47
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

  2. #2
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840

    Re: Webform error - "It is already opened exclusively by another user, or you need (..)"?

    You need to share the folder containing the project with full access.

    I had the same problem once, and I think it's due to the fact that you are using simple filesharing on an NTFS drive.
    In my case, the problem occured on an existing working app after a reinstall where I switched from FAT32 to NTFS.
    Sharing the folder worked for me.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  3. #3
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: Webform error - "It is already opened exclusively by another user, or you need (..)"?

    i think you could just right click the mdb file, and from the security tab, allow everyone to read and write on the file. (this is a very general solution).

    or you can grant the asp.net user full access over this file. (which i think is the right way to do it).

    anyway as pax said, it is a matter of permessions and if you are using vs2002/2003 then i would recommend checking the iis security settings for this mdb file


    rgds

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    8

    Re: Webform error - "It is already opened exclusively by another user, or you need (..)"?

    Okay I'm getting closer now...

    My file system is in fact NTFS, but I don't have a security tab on my file(s). What gives?

    How would I grant full permissions to ASP.NET ?? Where would I check the IIS security settings for that particular mdb ?? What exactly do I need to change?

    Please, you guys are very helpul! Thanks!

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    8

    Re: Webform error - "It is already opened exclusively by another user, or you need (.

    Ok, I've been playing with those permission, and now no matter if I'm trying to instantiate my dataset or not, I'm getting "The page cannot be displayed " error. Any ideas how to reset settings to default ?
    Last edited by JayZeus; Apr 11th, 2006 at 03:59 PM.

  6. #6
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840

    Re: Webform error - "It is already opened exclusively by another user, or you need (..)"?

    Quote Originally Posted by JayZeus
    Okay I'm getting closer now...

    My file system is in fact NTFS, but I don't have a security tab on my file(s). What gives?

    How would I grant full permissions to ASP.NET ?? Where would I check the IIS security settings for that particular mdb ?? What exactly do I need to change?

    Please, you guys are very helpul! Thanks!
    The reason for this is that you are using simple filesharing.
    The security is only there if you disable simple filesharing, which is usually only on pc connected to a domain. (or if it has multiple users)
    Just share the folder containing the app, with full access.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  7. #7

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    8

    Re: Webform error - "It is already opened exclusively by another user, or you need (.

    Thank you all, I got it! I also needed to set permissions and configure in the IIS that's why It was giving me some problems.

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width