Solved

Access .accdb file size issues

Posted on 2013-05-30
7
551 Views
Last Modified: 2013-05-31
I have a client server application where both the front and back end databases are in excess of 1 GB. Lately, I have been running some functions that create an Excel object and populate it - sometimes with several thousand rows of data - and both my front end and back end .accdbs explode up to 1.8 - 2 GB, which makes them crash.

I have added "compact on close" to my database settings and eventually plan to move the back end to MS SQL Express, but I don't have much experience with MS SQL and until I get a little experience using it I don't want to make the move because my department depends on these applications. I am also wondering if memory problems on my computer may be causing the database problems.

Any suggestions will be appreciated.

Thanks.
0
Comment
Question by:Buck_Beasom
7 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 400 total points
ID: 39209062
Memory should not make a difference, but there are two things which you can do which should:

1. For any query you use that adds,deletes, or updates, make sure the UseTransaction property is set to no.

2. If your using temp tables, consider using a temp database.  Create another DB when the import process starts, create tables in it using the TransferDatabase method (you keep a blank table in the current DB as a template), and then have a link to the temp DB.

  You can then use the temp tables and as soon as your done, delete the temp DB.  

  Sounds like a lot, but it really requires very little work to setup.

Jim.
0
 

Author Comment

by:Buck_Beasom
ID: 39209103
Thank you. The application launches 19 queries and virtually all of them are add, delete or update queries. I will do as you suggest and get back with the results in the AM.
0
 

Author Comment

by:Buck_Beasom
ID: 39209139
It helped some, but the app file still jumped up by almost half a gig. I am executing a bunch of embedded queries in the code. Is there something I can do with those queries to make them launch with "UseTransaction" set to no? I am using the DoCmd.RunSQL method.

Thanks.
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 50 total points
ID: 39209322
I don't think there's much you can do about that. When you're manipulating data, you're going to bloat the database.

As JimD suggests, you can use an external database to do your manipulations, and then Import the finished data to your live database (and then compact that). You can then delete the temporary database, and recreate it as needed.
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 50 total points
ID: 39209341
"where both the front and back end databases "
"I have added "compact on close" to my database settings"
Unless you are manually opening and closing the db with C on C set, nothing will happen. For example, if you have C on C set on the backend, and you are running these processes from the front end - linked (or otherwise) to the back end,  then C on C does nothing.
Just an FYI.
0
 

Author Closing Comment

by:Buck_Beasom
ID: 39210399
I tried to split the points up to recognise that Jim's solution gave me the best results, but that I appreciate the other input. I am aware that C on C in the Front End will not impact the back end and I am investigating ways to do auto-compact to the back end. It's obvious I'm going to need some creativity until I can get this onto MS SQL - probably multiple front and back ends. There are multiple issues - size of the files, extent of the application and the fact that I can't join tables in two different back ends. (Or if I can, I still have to figure it out.)

In any event, thanks to all.
0
 
LVL 57
ID: 39210432
<<I am aware that C on C in the Front End will not impact the back end and I am investigating ways to do auto-compact to the back end.>>

  You can call for a compact on the BE through DAO as long as:

1. No other users are in the BE

2. The current FE has no connections to the BE.

  Being that it is data only, there's no problem calling for a compact through JET.  

Jim.

    ' Do we need to do a compact?
    If intCallCompact = True Then
   
      ' Close forms recordset
      Call AddLineToLog("Compact Back End - Disconnecting")
     
      strDBPath = GetAttachedPath_TSB("", "tblErrors")
      strDBPath = Left$(strDBPath, Len(strDBPath) - 12)
     
      ' Make sure a copy of the compacted MDB does not exist.
      KillFile_TSB (strDBPath & "NETCPTMP.MDB")
     
      ' Do a compact on the BE database.
      Call AddLineToLog("Compact Back End - Compacting")
      DBEngine.CompactDatabase strDBPath & "NETCPDAT.MDB", strDBPath & "NETCPTMP.MDB"
       
      ' Make sure the orig does not exist.
      intRet = KillFile_TSB(strDBPath & "NETCPDAT.MDB")
     
      ' Copy the compacted file back
      Call AddLineToLog("Compact Back End - Copying compacted database")
      intRet = CopyFile_TSB(strDBPath & "NETCPTMP.MDB", strDBPath & "NETCPDAT.MDB")
       
      ' NETCPTMP is left on purpose in case of a problem.
       
      Call AddLineToLog("Compact Back End - Compact complete")
   End If
  End If
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

816 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now