[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access .accdb file size issues

Posted on 2013-05-30
7
Medium Priority
?
565 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
[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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 1600 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 200 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 200 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 58
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

Hire Technology Freelancers with Gigs

Work with 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

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…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

649 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