Solved

Access .accdb file size issues

Posted on 2013-05-30
7
548 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

896 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

12 Experts available now in Live!

Get 1:1 Help Now