Solved

Access .accdb file size issues

Posted on 2013-05-30
7
555 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
Independent Software Vendors: 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 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 - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IIF syntax in MS Access 1 63
MS Access Subform Unique Records Issue 14 37
Microsoft Access 2016 Bug? 9 46
How display file name that two linked table reside in on a form 4 28
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

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