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
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