Developer forum

Forum » Development » Custom module database error

Custom module database error


Reply

When viewing a custom module front-end page, some times it crashes, and shows the following error:

The MSA database 'Dynamic.mdb' could not be opened - the error is:

System.Data.OleDb.OleDbException: Unspecified error
   at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
   at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.OleDb.OleDbConnection.Open()
   at Dynamicweb.Database.GetConn(String strDatabase)

Support told me that the following was in the event log, but could not help :

The description for Event ID ( 9876 ) in Source ( ASP.NET 2.0.50727.0 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description see Help and Support for details. The following information is part of the event: The MSA database ''Dynamic.mdb'' could not be opened - the error is: System.Data.OleDb.OleDbException: Unspecified error
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at Dynamicweb.Database.GetConn(String strDatabase).


Does anyone know about this problem? It seems to be a problem related to using an access database solution. Is SQL database required for custom modules to work? 


Replies

 
Reply
Hi there,

Can you define "sometimes it crashes"? Is there a pattern you can see?

Also, can you show us the code you're using in your custom module that accesses the database? AFAIK, Access should work fine in custom modules. The only problems I've had with Access is when I try to run the site in 64 bit mode, but you would have discovered that much sooner ;-)

Cheers,

Imar
 
Nicolai Høeg Pedersen
Reply
I've seen similar behaviour from time to time.

My guess is one of of 2 things:
- Are you 100% sure you are disposing your connection and readers? This is OleDB and GC will not do it for you, and even if it would - still make sure to dispose. So wrap every connection and reader in using statements.

- Do you create connections inside a loop? Could also cause a problem.
 
Reply
Thanks guys
- i AM connecting in a loop, so about 30 connections to show the calendar. I'll try to check if i dispose of the connections properly, or i'll try to put everything in 1 connections into an array instead.

 

You must be logged in to post in the forum