Last post Apr 10, 2008 09:48 AM by mmeisel
Apr 04, 2008 11:01 AM|mmeisel|LINK
I recently wrote an ASP.NET application that interacts with a Microsoft Access database. I have this web application set up in 2 environments, on my PC (localhost), and on a web server. The application on the web server gets the error "Cannot open any
more tables" every so often but this never happens on my PC. Both my PC and the web server have the latest Jet 4.0 but my PC is XP and the web server is Windows Server 2003. I have done some research about this problem and I insured that I am closing all
connections and recordsets as well as setting them equal to nothing (i.e. myConn.Close, myConn = Nothing). Since this only happens on the web server, and not my PC, I believe it might have something to do with the configuration of the web server (probably
pretty obvious). Below is the stack trace, I don't know if that would be helpful. Be fore-warned, there are 2-3 datareaders open at any given time (it is necessary based on the nature of the project).
[OleDbException (0x80004005): Cannot open any more tables.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +267
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +192
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +48
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +106
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +111
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +4
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Apr 05, 2008 03:00 AM|Mikesdotnetting|LINK
Not an error message I have come across, but given that it works fine when one person is accessing the app on your machine, but I presume more people are accessing it on the web server, perhaps you have reached the limits of Access. Or, at least, the way
you are accessing it in code has pushed it over the liimit. Difficult to say, without seeing how you are managing your data access.
What "Recordsets" are you referring to? Are you perhaps using ADO? Can you look at caching instead of having multiple DataReaders in operation simultaneously? Possibly even using DataSets? Can you identify a particular set of operations that are more
likely to lead to the error condition?
Apr 07, 2008 11:52 AM|mmeisel|LINK
More people are not accessing on the web server than on my computer. It was initally released to 2 other people but I have since taken their access priveledges away. So basically its just me on both my computer and the web server. I can generate the error
on the web server but not on my PC.
When I said "recordsets" I meant data readers. I close them and set them to Nothing after I have used them. Should/Do I need to close the Cmd object? For instance....
myDataReader = Cmd.ExecuteReader()
myDataReader = Nothing
Cmd = Nothing ' ?????
Just a thought, I am still new at ASP.NET.
Apr 07, 2008 12:08 PM|Mikesdotnetting|LINK
I think you may need to reinstall the Jet Provider and/or MDAC on the server. Unless you have something really wacky like a Select statement running in the Selected Event of a Datasource control....
Apr 10, 2008 09:48 AM|mmeisel|LINK
I wonder if I put the ASP files on their local computer and put the database on a server where everyone can access it, maybe that would help.
Does anyone know how to access an Access DB on a different server? For instance, if the web files are on my machine but the database is on server XYZ, what would the connection string look like? Would I possibly have to map a drive?