Sign In  |  Register
 
 DotNetNuke Powered!
DotNetNuke Support Forums

Access 97

Rate this topic:

Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

AuthorMessages
tigris7
Posts:18



04/24/2007 6:49 PM  

HI, I 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:

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     in web.config and now I get :

 

 

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?

Unspecified error

Server Error in '/MySampleApp' Application.

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.

John Mitchell
Posts:3196



04/25/2007 9:12 AM  
It looks like you need to use Server.MapPath so that you get a physical path instead of a virtual one.

If you are actually using a UNC path, then you will need to make sure that the anonymous web user has write permission on the folder that the DB is in.
tigris7
Posts:18



04/25/2007 10:09 AM  
First, thanks for your response.

I verified that the anonymous web user has write permission. Still no luck.

As far as server.MapPath goes, I am using VS.NET 2005 and had created a TableAdapter to connect to the db. When I am in the .xsd file, the table adapter GUI, I can connect and query the db no problem. But then it throws the error when I run it from the page. I guess I am unsure how to use the server.mappath since the connection string is in the web.config file like so:


connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\myServerIP\drive-c\PFGDB\pru-desk2.mdb"
providerName="System.Data.OleDb" />

The db is not on the same web server. I am still getting the unspecified error at the end of this post.

Any more suggestions?

Frank


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.70mf6i6d.5.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.70mf6i6d.5.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


John Mitchell
Posts:3196



04/25/2007 10:20 AM  
If the db is on another server then your web user has to have write permission on that other server.

You will also need to for the webserver to be able to create temporary files for access in it's own temp folder.

Setting up a db app like this has lots of potential for failure.
Since it is MS Access and file based the file can be locked on the other server by a different user.
John Mitchell
Posts:3196



04/25/2007 10:23 AM  

Here's some more things to look into:

http://databases.aspfaq.com/database/why-can-t-i-access-a-database-or-text-file-on-another-server.html

 

tigris7
Posts:18



04/25/2007 11:40 AM  
John,

Thanks very much for your efforts.

"If the db is on another server then your web user has to have write permission on that other server."
I believe I have that covered. I have added the aspnet user, the anon-web user, and IUSR_myMachine to the share, folder, and db, all with full rights for testing purposes.

"You will also need to for the webserver to be able to create temporary files for access in it's own temp folder."
Not sure what you mean by that... how would i do that?

The article is really good. Thanks. I followed it to add the IURS, but now I only get the following error. I think we will give up. It sucks that we are forced into using Access 97, but that is how it is right now. With sql server we are able to connect no problem, but no luck with this.

Thanks again,
Frank


he Microsoft Jet database engine cannot open the file '\\myServerPath\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 '\\myServerPath\drive-c\PFGDB\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.tivfa8wz.7.vb    Line: 685

Stack Trace:

 
[OleDbException (0x80004005): The Microsoft Jet database engine cannot open the file '\\myServerPath\drive-c\PFGDB\pru-desk2.mdb'.  It is already opened exclusively by another user, or you need permission to view its data.]
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.tivfa8wz.7.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
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.




ActiveForums 3.7
Visit our Store for great DotNetNuke Modules and Skins
DNNMasters Sitemap/Google Sitemap 3.0

Item codeSM3-01
Price$29.00
Product Information 
DotNetNuke CSS NavMenu 3.3 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
Snapsis PageBlaster 3.3.2 for DotNetNuke - Professional Edition

AuthorJohn Mitchell
Base Price$79.00
Product Information 
XDAkuna (Web 2.0 CSS XHTML Skin)

Item codeXDAkuna
AuthorNina Meiers
Price$49.00
Product Information