473,770 Members | 3,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4156
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 InstantiateDate Time
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 InstantiateDate Time
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.a u...
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
6960
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 calculations. One of these calculations is rather complex, and could not be implemented properly using just nested IIF statements or anything similar, so was coded using VBA (in the VBE) as a function. This calculation is included in a query in the...
6
3672
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 server, has suddenly started running very slowly. The network engineer has thrown up his hands and said "It's Access 97". I've checked out lots of things including the Oplocks setting and other stuff from this NG, and I think I've done everything...
30
35892
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
3172
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 tables in it. One of my forms has two TEXT BOX controls formated as Short Date. The form is binded to a linked table. The linked tables has about 7 records and one of the control is binded to a table field. These two controls displays the date...
5
14773
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 different because I directly import the data from a .csv file), I do not want to create dozens of queries to be able to get the results of the different tables.
4
2653
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 don't work for myself if you get my drift....anyways even if this is not asked of you...it might get you on friendly terms with the lawyers in the office The code is written to extract information from a table with contract information and divide...
7
35068
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 for doing this is the following: I have two databases, call them A and B. - Database A is linked to a table in database B. - Database B is updated automatically using Windows Scheduler, on the hour. - If an object in Database A with a...
4
2083
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 compacting the MDB application. I have tried to performing the linking of tables and compacting before I install them in the user's workstation. But they are still seeing the VBA script editor every now and then. Mostly, after the first occurence, it...
4
2823
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 and everytime i try to enter VBA it hangs so i cant find a way to fix it. I belive that it corrupts in some of the code i wrote yesterday. This is an extraordinary fault, i have never seen access behave like this in my 2-3 years of experience. I...
0
10228
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10002
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9869
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8883
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.