Connection trouble - confused HELP!

Last post 11-19-2003 3:25 PM by Bachino. 4 replies.

Sort Posts:

  • Connection trouble - confused HELP!

    07-23-2002, 12:54 PM
    • Member
      15 point Member
    • flecktones
    • Member since 07-23-2002, 12:39 PM
    • Boston
    • Posts 3
    I have one web page in my project that works fine against this database. I can read and write to it without any problem with oledbcommands and oledataadapters. Every other form tells me the database is locked or I don't have permission. the test I just did just has a connection, dataadapter, dataset and one dropdownlist control that I try to populate on load. Here is the message:


    The Microsoft Jet database engine cannot open the file 'C:\STC\STC-Competitions.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:\STC\STC-Competitions.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

    Source Error:


    Line 92:
    Line 93: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Line 94: Me.OleDbDataAdapter1.Fill(DataSet21)
    Line 95: DataBind()
    Line 96:


    Source File: C:\Inetpub\wwwroot\STCnew\WebForm6.aspx.vb Line: 94

    Stack Trace:


    [OleDbException (0x80004005): The Microsoft Jet database engine cannot open the file 'C:\STC\STC-Competitions.mdb'. It is already opened exclusively by another user, or you need permission to view its data.]
    System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
    System.Data.OleDb.OleDbConnection.InitializeProvider()
    System.Data.OleDb.OleDbConnection.Open()
    System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
    System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
    STCnew.WebForm6.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\STCnew\WebForm6.aspx.vb:94
    System.Web.UI.Control.OnLoad(EventArgs e)
    System.Web.UI.Control.LoadRecursive()
    System.Web.UI.Page.ProcessRequestMain()


  • Re: Connection trouble - confused HELP!

    07-25-2002, 12:15 PM
    • Member
      15 point Member
    • flecktones
    • Member since 07-23-2002, 12:39 PM
    • Boston
    • Posts 3
    Solved my own problem. I have NO idea why this particular Access DB gives me trouble, but I had another copy of it and the other copy works fine. THe problem database was a copy of the one that works.

  • Re: Connection trouble - confused HELP!

    07-25-2002, 9:28 PM
    • Contributor
      4,745 point Contributor
    • bdesmond
    • Member since 06-15-2002, 6:02 PM
    • Chicago, IL USA
    • Posts 944
    • TrustedFriends-MVPs
    Whats happening is that another process is locking your database and opening it in exclusive mode (as opposed to shared). Exclusive mdoe means that only the person who hs the db open can open it at any given time. In shared mode, multiple people can have the db open. It has to be open exclusive for modifying it (forms, table layouts, reports, etc). You can do SELECTS, INSERTS, UPDATES, and DELETES in shared mode, generally you'll want to lock the record, so that nobody modifies the record you're working with before the new version is sent in.

    To set these paramterers, you have to add certain things to the connection string. I don't have a quick link to all this. Best bet is to either search the knowledge base (support.microsoft.com) under the Jet Engine for Connection Parameters, or the Visual Studio Help files for connection parameters.
    --Brian Desmond
    Windows Server MVP - Directory Services
    http://www.briandesmond.com
  • Re: Connection trouble - confused HELP!

    11-15-2003, 3:44 PM
    • Member
      55 point Member
    • jitu99
    • Member since 11-15-2003, 3:27 PM
    • Posts 11
    Hi All,
    I'm facing the same problem of accessing any Access Database. I can access any database at home which is running .Net framework 1.0 and office 2000.
    But the same application if installed on another machine which is runing .Net Framework v1.1 and office XP is giving the error that the Access DB is open exclusively by somebody, when there is no one accessing that Database.
    I tried creating a user ASPNET in access database and gave all authority to the ASPNET user.
    Then came back to the application in VS.NET 2003 and created another connection with ASPNET user and tried the TEST CONNECTION option and that failed. So I used Admin.
    But no luck. Its frustrating !!!

    Please HELP!!!!.
  • Re: Connection trouble - confused HELP!

    11-19-2003, 3:01 PM
    • Member
      70 point Member
    • Bachino
    • Member since 04-13-2003, 12:45 PM
    • Milton Keynes, UK
    • Posts 14
    I had this problem, but if you look at the ASPNET user, it belongs to the "User" group in Windows.. If you have both ASPNET and Users both in your NTFS folder security settings then they will both need to have full control (or at least read/write etc) as the one with the lowest rights will basically overrule.. What I found was I'd given ASPNET full control but Users could only view the data..

    Also making sure that the properties that you set in the database folder are recursive, so that all files stored within will inherit the properties, you may find that you've set the folder rights, but not that actual database itself.

    Hope this helps, let me know if it does or doesn't..


    David
Page 1 of 1 (5 items)