Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Connect to Access97Connect to Access97
Previous
 
Next
New Post
4/24/2007 7:42 PM
 

HI am developing a custom module that needs to connect to an Access 97 db.

If I do this in a simple asp.net web app, no problem.

When I try it from my DNN module, I first got the following error:

Server Error in '/MySampleApp' Application.

The Microsoft Jet database engine cannot open the file '\\A-main\drive-c\PFGDB\pru-desk2.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 '\\mypath\pru-desk2.mdb'.  It is already opened exclusively by another user, or you need permission to view its data.

Source Error:

Line 683:            Me.Adapter.SelectCommand = Me.CommandCollection(0)
Line 684: Dim dataTable As AccessDS.CustomerDataTable = New AccessDS.CustomerDataTable
Line 685: Me.Adapter.Fill(dataTable)
Line 686: Return dataTable
Line 687: End Function

Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\statements_dnn\2cc2f465\ac391928\App_Code.4cgoapqt.2.vb    Line: 685

 

 

 

Then I uncommented     <identity impersonate="true" /> in web.config and now I get :

 

 

Unspecified error

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: Unspecified error

Source Error:

Line 683:            Me.Adapter.SelectCommand = Me.CommandCollection(0)
Line 684: Dim dataTable As AccessDS.CustomerDataTable = New AccessDS.CustomerDataTable
Line 685: Me.Adapter.Fill(dataTable)
Line 686: Return dataTable
Line 687: End Function

Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\statements_dnn\2cc2f465\ac391928\App_Code.4cgoapqt.2.vb    Line: 685

Stack Trace:

[OleDbException (0x80004005): Unspecified error]
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1054705
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +53
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.OleDb.OleDbConnection.Open() +37
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +107
AccessDSTableAdapters.CustomerTableAdapter.GetData() in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\statements_dnn\2cc2f465\ac391928\App_Code.4cgoapqt.2.vb:685

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +72
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +296
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +482
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2040
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

 

 

 

 

Anyone have any experience with this?

 
New Post
4/24/2007 9:07 PM
 

It is probably because you have open connection/file with some other application (ms access or another component or another web page)

Primoz

 

 
New Post
4/25/2007 9:42 AM
 

Thanks for the feedback. Yes, I thought about that before I made this post. To verify if that is what was happening, I made a copy of the db, renamed it, edited the connection string to point to the renamed copy (which I know for sure nothing else was connected to), and still received the errors outlined above.

Any other suggestions? I was hoping someone had tried to connect to Access 97 before.

 
New Post
4/25/2007 10:29 AM
 

If you are impersonating identities you want to make sure that your web application has permissions to access the file.  If you are not using impersonation you will want to ensure that the ASP.NET worker process has permissions to the file.  That should resolve the issue.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
4/25/2007 3:16 PM
 

I did create module that can use ms access 97 db just fine. Do you access db file  more than once? Do you close connection when you do not need it any more?

Primoz

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Connect to Access97Connect to Access97


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out