Results 1 to 8 of 8
  1. #1
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206

    Post Cannot open any more databases.

    Hi.

    I have 68 queries, whose results are merged into a single query via UNION. However, when I filter the data displayed by this single query, I get the message "Cannot open any more databases." The data is returned properly without any errors if I just simply open the query though.

    I want to know why this message comes out. I have no way of designing my queries other than using a UNION.



    Other details:
    1. I am simply opening a query. I do not access this query via DAO or any other programmatic means.
    2. The error comes out even if I am the only one using the database.
    3. The database has 80 or so tables.
    4. There are 68 queries in all, 33 of them are "primary" queries, while the rest are for subqueries that I need in order to formulate the "primary" queries more easily.
    5. The 33 "primary" queries do not display any error message when opened.
    6. The UNION query is the only open object.

    Hope I get a response. Thanks.

  2. #2
    ghodges is offline Novice
    Windows 7 Access 2000
    Join Date
    Aug 2010
    Posts
    6
    this is certainly a large problem

    The only possible way that i think to solve this may be to do some of your queries and use your results to generate temporay tables.

    This would simplify the calculations involved, but significantly make you program more difficiult to understand......

    maybe helpful......maybe not

    Geoff

  3. #3
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,045
    Hi,

    needing 68 queries in a union query might be a serious indicator that it's time to review your database design...

    greetings
    NG

  4. #4
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206

    Post

    Thanks for the replies, ghodges (Geoff) and NoellaG (NG).

    As far as database design is concerned (tables and relationships), I am confident that I created balance between theory and real-world requirements of the system.

    It is an accounting database that has at least 20 modules (all dealing with entirely different sets of transactions), and most of them need to output an automated journal entry. Hence, the need for union queries.

    Code:
    Invoice Module
    Debit   Accounts Receivable
    Debit   Sales Discounts
    Credit     Sales Tax Payable
    Credit     Sales
    
    Collection Module
    Debit   Untransferred Collections
    Debit   Creditable Withholding Tax
    Credit     Accounts Receivable
    
    Remittance Module
    Debit   Transferred Collections
    Debit   Collection Short or Over
    Credit     Untransferred Collections
    
    Deposit Module
    Debit   Cash in Bank
    Debit   Deposit Short or Over
    Credit     Transferred Collections
    
    Returned Checks Module
    Debit   Accounts Receivable
    Credit     Cash in Bank
    
    Inventory Purchases Module
    Debit   Inventory
    Debit   Sales Tax Payable
    Credit     Inventory - Trade Discounts
    Credit     Accounts Payable - Clearing
    
    Fixed Asset Purchases Module
    Debit   Fixed Assets
    Debit   Sales Tax Payable
    Credit     Accounts Payable - Clearing
    
    Accounts Payable Module
    Debit   Sundry Assets and Expenses
    Debit   Accounts Payable - Clearing
    Credit     Accounts Payable
    
    Check Disbursement Module
    Debit   Sundry Assets and Expenses
    Debit   Accounts Payable
    Credit     Cash in Bank
    
    Inventory Withdrawal Module
    Debit   Accounts Payable
    Debit   Inventory Losses
    Credit     Inventory
    
    Inventory Transfer Module
    Debit   Inventory
    Credit     Inventory
    
    General Journal Module
    Debit   Sundry Debits
    Credit     Sundry Credits
    There are other modules I didn't mention here.

    Each debit require one regular query.
    Each module (a cluster of debits and credits) require one union query.
    Finally, the entire general ledger requires a union query consisting of all modules.

    Geoff, I can implement your recommendation that I accumulate my data in a temporary table, instead of forcing all data to merge in a union query. That is actually quite simple to do.

    What I do not know is the use of temporary tables itself. Is it the same as using temporary tables in SQL Server (#table)? Or is it a permanent table on which I do DELETE and INSERT operations? I heard that doing frequent DELETEs and INSERTs on a permanent table holding a huge set of data makes a database prone to fragmentation and corruption.

    I consider myself skillful in designing databases (myself being the judge), but I do not know any optimization I must do in an Access database.

    Thanks for any help I am about to receive.

    Joe.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I usually put my temporary tables (if I need them) in a separate database and delete the database when done.

  6. #6
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Quote Originally Posted by RuralGuy View Post
    I usually put my temporary tables (if I need them) in a separate database and delete the database when done.
    a temporary table will help you out, no matter you put in same database or separate database.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by weekend00 View Post
    a temporary table will help you out, no matter you put in same database or separate database.
    It is just that you avoid the bloat by putting it in another db.

  8. #8
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    Thanks for helping me guys!
    I'll mark this as solved.
    Now, I need to work on the best way of implementing a temporary table.

    Cheers!

    Joe

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Two databases, One Form
    By 95DSM in forum Access
    Replies: 4
    Last Post: 07-22-2010, 02:43 PM
  2. Cannot open any more databases error
    By Matthieu in forum Access
    Replies: 2
    Last Post: 04-14-2010, 03:29 PM
  3. Replies: 2
    Last Post: 02-26-2010, 08:14 AM
  4. Transfering Databases
    By GMatos78 in forum Access
    Replies: 3
    Last Post: 01-13-2010, 12:15 PM
  5. Combining Databases
    By RHall in forum Access
    Replies: 2
    Last Post: 04-13-2006, 07:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums