aspx Error Message

G

Guest

When the following VB code is executed (code from an aspx page), the
following error message is issued: "Microsoft Access can't open the
database because it is missing, or opened exclusively by another user. "

The Access database is not opened by another so I don't know why it is being
issued.

Any ideas?

VB Code
'Declare Variables
Dim acApp As Microsoft.Office.Interop.Access.Application()
Dim strDir as String
Dim strFile As String

strDir = "C:\myDocs\"
strFile = "ProfitabilityData.mdb"

'Open Access Application
acApp = CreateObject("Access.Application")
acApp.Application.Visible = True
acApp.OpenCurrentDatabase(strDir & strFile, True) '** Error occurs
here **


Full Text of error message:

Microsoft Access can't open the database because it is missing, or opened
exclusively by another user.
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.Runtime.InteropServices.COMException: Microsoft
Access can't open the database because it is missing, or opened exclusively
by another user.

Source Error:

Line 80: acApp = CreateObject("Access.Application")
Line 81: acApp.Application.Visible = True
Line 82: acApp.OpenCurrentDatabase(strDir & strFile, True)
Line 83:
Line 84: 'Read Textfiles into Reserve Database

Source File: C:\Inetpub\wwwroot\ReserveDB\WebForm1.aspx.vb Line: 82

Stack Trace:
[COMException (0x800a1eba): Microsoft Access can't open the database because
it is missing, or opened exclusively by another user.]

Microsoft.Office.Interop.Access.ApplicationClass.OpenCurrentDatabase(String
filepath, Boolean Exclusive, String bstrPassword) +0
ReserveDB.WebForm1.btCreateProfitDB_Click(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\ReserveDB\WebForm1.aspx.vb:82
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1281

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.6018; ASP.NET
Version:1.0.3705.6018


Thanks, Mark
 
M

Mr Newbie

The most likely scenario is that you have opened the database from your
program and have either forgotton to close the connection or during
debugging it did not get that far in the program before you ended debugging.
In this situation you may have to log off or reboot.

HTH

Mark said:
When the following VB code is executed (code from an aspx page), the
following error message is issued: "Microsoft Access can't open the
database because it is missing, or opened exclusively by another user. "

The Access database is not opened by another so I don't know why it is
being
issued.

Any ideas?

VB Code
'Declare Variables
Dim acApp As Microsoft.Office.Interop.Access.Application()
Dim strDir as String
Dim strFile As String

strDir = "C:\myDocs\"
strFile = "ProfitabilityData.mdb"

'Open Access Application
acApp = CreateObject("Access.Application")
acApp.Application.Visible = True
acApp.OpenCurrentDatabase(strDir & strFile, True) '** Error occurs
here **


Full Text of error message:

Microsoft Access can't open the database because it is missing, or opened
exclusively by another user.
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.Runtime.InteropServices.COMException: Microsoft
Access can't open the database because it is missing, or opened
exclusively
by another user.

Source Error:

Line 80: acApp = CreateObject("Access.Application")
Line 81: acApp.Application.Visible = True
Line 82: acApp.OpenCurrentDatabase(strDir & strFile, True)
Line 83:
Line 84: 'Read Textfiles into Reserve Database

Source File: C:\Inetpub\wwwroot\ReserveDB\WebForm1.aspx.vb Line: 82

Stack Trace:
[COMException (0x800a1eba): Microsoft Access can't open the database
because
it is missing, or opened exclusively by another user.]

Microsoft.Office.Interop.Access.ApplicationClass.OpenCurrentDatabase(String
filepath, Boolean Exclusive, String bstrPassword) +0
ReserveDB.WebForm1.btCreateProfitDB_Click(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\ReserveDB\WebForm1.aspx.vb:82
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1281

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.6018;
ASP.NET
Version:1.0.3705.6018


Thanks, Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access database won't open 2
FoxPro database connectivity 0
Error Message 2
compiler error message 3
asp error handling 1
Cannot Open Access File 31
401 unauthorized message 3
Compiler Error Message: CS1595 6

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top