473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VBA: Cannot open anymore tables

Q. How can I 'see' the number of table id's access is using for tracking
recordsets?

Details:
I have some ado code that itterates through a recordset and calls a
procedure on each record. This procedure calls a hierachy of other
subs/functions etc which _do_ instantiate several custom objects (class
modules), recordsets, both ado and dao at different times. Eventually the
code breaks with the error number -2147467259, (though has also been
broken with error number 3048 - I assume whether it breaks during an ADO
or DAO operation) and the message "Cannot open any more tables"

I believe (I've checked several times and am about to check again) that
every object (custom or access) is closed and set = nothing, so the
number of table id's at any given time shouldn't be extraordinary.

In theory, if everything is being closed and all garbage being collected,
I should be able to iterate through an infinite number of records and
execute this procedure, knowing that when the procedure finishes, things
are as they were when it started, but clearly they're not, and after about
250 records I get the error.

IF I can peek at some attibute of a recordset, or of the connection or of
something that gives me a hook into whats happening 'under the bonnet',
I can see when in the process the 'count' of table id's starts to climb,
I could then identify the problem.

any ideas?

Thx
Glenn
Nov 13 '05 #1
3 4127
Glenn Davy <gS***********@tpg.com.au> wrote in message news:<pa****************************@tpg.com.au>.. .
Q. How can I 'see' the number of table id's access is using for tracking
recordsets? <SNIP>
IF I can peek at some attibute of a recordset, or of the connection or of
something that gives me a hook into whats happening 'under the bonnet',
I can see when in the process the 'count' of table id's starts to climb,
I could then identify the problem.

any ideas?

Thx
Glenn


How about adding some code in your modules that does something like
giving an object's state. I'm pretty sure I've seen Steve Jorgensen
post this before. If you wanted, you could create a global integer of
open objects and a custom collection so you could add/remove items
from it. Whenever there was a change, you could output all the open
items/newly closed items to either a text file or to the debug window.
Something like

Variable_In_Use Calling_Module InstantiateDateTime
DestroyDateTime

Otherwise, you'll probably have to set watches and breakpoints
everywhere.
Nov 13 '05 #2
On Fri, 22 Oct 2004 04:47:15 -0700, Pieter Linden wrote:
Glenn Davy <gS***********@tpg.com.au> wrote in message news:<pa****************************@tpg.com.au>.. .
Q. How can I 'see' the number of table id's access is using for tracking
recordsets? <SNIP>

IF I can peek at some attibute of a recordset, or of the connection or of
something that gives me a hook into whats happening 'under the bonnet',
I can see when in the process the 'count' of table id's starts to climb,
I could then identify the problem.

any ideas?

Thx
Glenn

thx for replying Pieter
I like the idea of the global collection of custom objects because I could
add code in the initialize and terminate methods to maintain the
collection - I'm not sure how I'd use this for ado/access objects though,
without adding code each time an object is opened,closed or set =nothing.

Glenn

How about adding some code in your modules that does something like
giving an object's state. I'm pretty sure I've seen Steve Jorgensen
post this before. If you wanted, you could create a global integer of
open objects and a custom collection so you could add/remove items from
it. Whenever there was a change, you could output all the open
items/newly closed items to either a text file or to the debug window.
Something like

Variable_In_Use Calling_Module InstantiateDateTime
DestroyDateTime

Otherwise, you'll probably have to set watches and breakpoints
everywhere.


Nov 13 '05 #3

"Glenn Davy" <gS***********@tpg.com.au> wrote in message
news:pa****************************@tpg.com.au...
Q. How can I 'see' the number of table id's access is using for tracking
recordsets?


There is no way to get the internsl count of TABLEIDs that have been opened.
You can get estimates by looking at how many objects you have opened but on
the whole its better to just work hard to open fewer objects....
--
MichKa [MS]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David | last post by:
Hi everyone. I have read every page that Google returns on this topic, but can't find anything that resolves my problem. Basically, I have an Access Database that does a number of different...
6
by: Terry Bell | last post by:
We've had a very large A97 app running fine for the last seven years. I've just converted to SQL Server backend, which is being tested, but meanwhile the JET based version, running under terminal...
30
by: S. van Beek | last post by:
Dear reader A record set can be empty because the condition in the query delivers no records. Is there a VBA code to check the status of a record set, record set empty
5
by: Easystart | last post by:
Hi, Sorry for my English. English is not my native tougue. I am working in MS Access 2000 with a SQLServer 2000 Backend database. MS Access 2000 is my GUI front end that has SQLServer linked...
5
by: laurentc | last post by:
Dear all, I have several tables based on exactly the same fields (Key/Date/Price1/Price2). I do some statistics on the prices. However, as I have many different tables (the tables are...
4
by: Kosmos | last post by:
Hey guys...as a relatively new programmer, I try to give back where I can. Below is the code for a useful program I believe many of you could use...just don't use the same exact code because...well I...
7
by: billelev | last post by:
Does anyone know if it is possible to close all objects in a database (tables, forms, queries etc.) using VBA code? I have not been able to find anything online to help me so far... My motivation...
4
by: Ben | last post by:
Hi! Just recently, I received complaints from users that every now and then the VBA script editor pops out for no reason. I made sure that the breakpoints have all been cleared before...
4
by: MrDeej | last post by:
Hello! I have a complex .accdb database which i after yesterdays changes cannot enter the VBA anymore. Most of the forms and all tables/queries works fine. But one of the forms causes it to hang...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.