Solved

Max number of stacked queries?

Posted on 2003-11-03
7
435 Views
Last Modified: 2009-07-29
Hi,

I have about six queries stacked in line. i.e. queries within queries...

Is there a maximum number of stacked queries allowed?

I just tried to add another query to the stack, and a simple answer seems un-obtainable. It is a three column query where on of the columns is a tickbox. When I set the criteria on the tickbox column to true, no records are returned. If I clear the criteria, there are records with both true and false returned values from the tickbox column.
This makes me beleive MS Access gives up when the queries are stacked so high.

Any help apprec...

LoveToSpod
0
Comment
Question by:LoveToSpod
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 32

Expert Comment

by:jadedata
ID: 9671514
Hey LoveToSpod!

 as Long as the number of total fields (Tables * Field) does not exceed 255 you will be within the limits.

regards
Jack
0
 
LVL 32

Accepted Solution

by:
jadedata earned 400 total points
ID: 9671538
There is also the point when Access can no longer track the lowest level query in the stack space, which is a less calculable value.

You need to look at combining some of the lower level queries or switch to some temporary tables in order to make the data more static at the time the upper level queries try to evaluate the data.
0
 
LVL 4

Expert Comment

by:Poppekop
ID: 9671631
if it is a yes/no field, try putting condition to -1 instead of true (just a wild guess)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Assisted Solution

by:jpolin1
jpolin1 earned 100 total points
ID: 9671649
I would stay away from the stacked queries anyway. It is hard for someone else to figure
out what you were trying to return from the DB.
0
 
LVL 32

Expert Comment

by:jadedata
ID: 9671916
I agree with jpolin1 here.  Stacked queries, UNLESS written and used by VBA code can be really ugly to iron out later if there are additional issues or change requests that have an impact on these queries.  Even for you as the developer, 3 months later.... (when the memory starts to go...)
0
 

Author Comment

by:LoveToSpod
ID: 9680116
Making Temporary tables is a good way of speeding things up, but I find inflates the size of the application requiring it to be compacted regularly. Jack, when you say temp taboes, are you talking recordsets? If so, I will need to brush up a little. Do recordsets inflate the size of the application too?

Thanks for your advices.

LoveToSpod
0
 
LVL 32

Expert Comment

by:jadedata
ID: 9680308
If you push those temp tables into a temp mdb you can throw them away with the bath water when the operation is completed

   dbengine.createdatabase("c:\folder\tempjunk.mdb")
   set dbTemp = opendatabase("c:\folder\tempjunk.mdb")
   ssql = "SELECT * INTO ["c:\folder\tempjunk.mdb"].[TempTable] FROM TableName WHERE ([This] = 'That');"
   currentdb.execute ssql, dbfailonerror

     'Your temp data is now in a "throw-away" temp container.
     'Perform ops on this data here
     'When done,....

   kill "c:\folder\tempjunk.mdb"

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question