Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / December 2004

Tip: Looking for answers? Try searching our database.

Access database won't open

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank Hayward - 23 Nov 2004 20:34 GMT
Hello.

I have created a database connection to an access database in my web
application. The problem is that I get the following error message, even
though nobody is connected to the database. I have tried a fresh boot,
downloading the latest Jet drivers, disabling the sql server, and moving the
database from c:\inetpub\wwwroot\web... to a spot on my hardrive, but none
of these has worked. I am following an exercise from a book so there is no
chance that I have made a coding error. I have also checked all permissions
and doubt that is the problem.

Please help

Thanks Frank
Server Error in '/web/DataWebTrial' Application.
----------------------------------------------------------------------------
----

The Microsoft Jet database engine cannot open the file 'E:\Documents and
Settings\Frank\My Documents\Visual Studio Projects\DataWebTrial\Data.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 'E:\Documents and Settings\Frank\My
Documents\Visual Studio Projects\DataWebTrial\Data.mdb'. It is already
opened exclusively by another user, or you need permission to view its data.

Source Error:

Line 116:    Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnLoad.Click
Line 117:        DsEmployee1.Clear()
Line 118:        OleDbDataAdapter1.Fill(DsEmployee1)
Line 119:    End Sub
Line 120:

Source File: c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb    Line:
118

Stack Trace:

[OleDbException (0x80004005): The Microsoft Jet database engine cannot open
the file 'E:\Documents and Settings\Frank\My Documents\Visual Studio
Projects\DataWebTrial\Data.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.FillFromCommand(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)
  DataWebTrial.WebForm1.btnLoad_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb:118
  System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument)
  System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
  System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
  System.Web.UI.Page.ProcessRequestMain()

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

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573
Mary Chipman - 25 Nov 2004 13:59 GMT
When you attempt to connect to an Access mdb from asp.net, you are not
connecting with *your* permissions on the file system, but with those
of the ASP.NET Machine Account (ASPNET). This is a restricted account
and is determined by the <processModel> section in the Machine.config
file. It affects all ASP.NET applications running on the server by
sandboxing them so that they do not have administrative file access on
the host box. Grant the necessary ACLs to ASPNET on the folders
containing the mdb and mdw files (read, write, delete so the .ldb
files get cleaned up).

--Mary

>Hello.
>
[quoted text clipped - 73 lines]
>Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
>Version:1.1.4322.573
CodeDevil - 05 Dec 2004 11:35 GMT
I met a problem like that once.

Try closing access and then try to connect to it from your code.  If
that doesn't work email me.

got a code problem? hand it to the devil.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.