2 Replies - 6968 Views - Last Post: 12 November 2005 - 08:28 PM

#1 juzmorons   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-July 03

Server Error

Post icon  Posted 10 July 2003 - 01:33 AM

Server Error in '/omg' Application.
--------------------------------------------------------------------------------

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

Source Error:


Line 29: {
Line 30: // Put user code to initialize the page here
Line 31: oleDbDataAdapter1.Fill(dataSet11);
Line 32: DataGrid1.DataBind();
Line 33:


Source File: c:\inetpub\wwwroot\omg\webform1.aspx.cs Line: 31

Stack Trace:


[OleDbException (0x80004005): The Microsoft Jet database engine cannot open the file 'C:\Documents and Settings\lhz\Desktop\db1.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)
omg.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\omg\webform1.aspx.cs:31
System.Web.UI.Control.onload(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


I've encounted the above problem. Can anyone help solve it? Help appreciated. :blink:

Is This A Good Question/Topic? 0
  • +

Replies To: Server Error

#2 klewlis   User is offline

  • cur tu me vexas?

Reputation: 8
  • View blog
  • Posts: 1,723
  • Joined: 09-November 01

Re: Server Error

Posted 10 July 2003 - 07:49 AM

basically, it means just what it says: the database can't be opened by two separate users at the same time. i think it counts the web server as one user and you as the other... i've had the problem where i can't view the page if i have access and the db open on my computer at the same time. try closing the db on your end... it's a pain to be opening and closing it all the time but it has to be done. :)
Was This Post Helpful? 0
  • +
  • -

#3 wanosd   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-November 05

Re: Server Error

Posted 12 November 2005 - 08:28 PM

Do this:

On top of your code, put the following:

OleDbConnection1.ConnectionString = "Provider=""Microsoft.Jet.OLEDB.4.0"";Data Source = """ + Server.MapPath("db1.mdb") + """"

Line 31: oleDbDataAdapter1.Fill(dataSet11);
Line 32: DataGrid1.DataBind();


So, it should look like this:


Line 30: OleDbConnection1.ConnectionString = "Provider=""Microsoft.Jet.OLEDB.4.0"";Data Source = """ + Server.MapPath("db1.mdb") + """"
Line 31: oleDbDataAdapter1.Fill(dataSet11);
Line 32: DataGrid1.DataBind();


NOTE: The code is all on ONE line.

=====

This will force it to read the db1.mdb file. If your OleDbConnection1 is named differently or the db1.mb file is named differently, just rename the code to reflect what they really are.

This post has been edited by wanosd: 12 November 2005 - 08:29 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1