473,473 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Access Database File Is Growing -- Not Sure Why

153 New Member
Hey guys, I was hoping someone could give me an idea of where I should look for this..my access database file is rapidly growing....but I have the access database import an excel spreadsheet and export an excel spreadsheet...and before and after the program is run I have every single table cleared. Right now the program is growing by 3 mb each time which is a reasonable size considering I am working with thousands of names and serial numbers, etc... which are then searched through millions of times to create a number set and primary key by which to sort by....it seems some or all of this data is being stored somewhere but surely not in my tables.
Any idea where to look?
Dec 1 '06 #1
7 4149
Kosmos
153 New Member
Could it be because I have fields indexed?
Dec 1 '06 #2
Kosmos
153 New Member
ahh nevermind tried getting rid of indexes...that doesn't work...please help lol
Dec 1 '06 #3
Kosmos
153 New Member
I found out that if I go under Tools and then Database Utilities there's an option to 'Compact and Repair Database..." This works to compact the database to the original size, but how can I code this into the form so that when they click the button that runs the program it always compacts and repairs before finishing?
Dec 1 '06 #4
ADezii
8,834 Recognized Expert Expert
Hey guys, I was hoping someone could give me an idea of where I should look for this..my access database file is rapidly growing....but I have the access database import an excel spreadsheet and export an excel spreadsheet...and before and after the program is run I have every single table cleared. Right now the program is growing by 3 mb each time which is a reasonable size considering I am working with thousands of names and serial numbers, etc... which are then searched through millions of times to create a number set and primary key by which to sort by....it seems some or all of this data is being stored somewhere but surely not in my tables.
Any idea where to look?
Do you try Tools, Options, General, Compact on Close
Dec 1 '06 #5
Kosmos
153 New Member
well I actually found what I was going for with the following code:

Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub

it still does help for me to set it that way in case I back up the databse the file does get a little bit larger until I run the program again so thank you for your advice as well...the thing is other people will be running on their computers and they might not have their computers set to that, but I will include that now in the directions file.

Thanks again.
Dec 1 '06 #6
NeoPa
32,556 Recognized Expert Moderator MVP
This function won't run directly as it refers to other procedures not available to you.
However, it should show you how to call the Compact & Repair feature from code.
Expand|Select|Wrap|Line Numbers
  1. 'CompactDb compacts a remote Access database.
  2. Public Function CompactDb(ByVal strDB As String, _
  3.                           Optional strPW As String = "", _
  4.                           Optional blnZip As Boolean = False) As Boolean
  5.     Dim strNewDB As String, strZip As String, strLocale As String
  6.  
  7.     On Error GoTo ErrorCDB
  8.     strNewDB = ParamReplace(strDB, ".Mdb", "New.Mdb")
  9.     Call Echo(True, "Compacting """ & strDB & """.")
  10.     If strPW <> "" Then strLocale = ";pwd=" & Scramble(strPW:=strLocale)
  11.     If Exist(strNewDB) Then Kill strNewDB
  12.     Call DBEngine.CompactDatabase(SrcName:=strDB, _
  13.                                   DstName:=strNewDB, _
  14.                                   DstLocale:=strLocale, _
  15.                                   SrcLocale:=strLocale)
  16.     Kill strDB
  17.     Name strNewDB As strDB
  18.     If blnZip Then
  19.         strZip = ParamReplace(strDB, ".Mdb", ".Zip")
  20.         Call Zip(strZip, strDB)
  21.     End If
  22.     Call Echo(True, """" & strDB & """ compacted.")
  23.     CompactDb = True
  24.     Exit Function
  25.  
  26. ErrorCDB:
  27.     CompactDb = False
  28. End Function
Dec 1 '06 #7
Kosmos
153 New Member
This function won't run directly as it refers to other procedures not available to you.
However, it should show you how to call the Compact & Repair feature from code.
Expand|Select|Wrap|Line Numbers
  1. 'CompactDb compacts a remote Access database.
  2. Public Function CompactDb(ByVal strDB As String, _
  3.                           Optional strPW As String = "", _
  4.                           Optional blnZip As Boolean = False) As Boolean
  5.     Dim strNewDB As String, strZip As String, strLocale As String
  6.  
  7.     On Error GoTo ErrorCDB
  8.     strNewDB = ParamReplace(strDB, ".Mdb", "New.Mdb")
  9.     Call Echo(True, "Compacting """ & strDB & """.")
  10.     If strPW <> "" Then strLocale = ";pwd=" & Scramble(strPW:=strLocale)
  11.     If Exist(strNewDB) Then Kill strNewDB
  12.     Call DBEngine.CompactDatabase(SrcName:=strDB, _
  13.                                   DstName:=strNewDB, _
  14.                                   DstLocale:=strLocale, _
  15.                                   SrcLocale:=strLocale)
  16.     Kill strDB
  17.     Name strNewDB As strDB
  18.     If blnZip Then
  19.         strZip = ParamReplace(strDB, ".Mdb", ".Zip")
  20.         Call Zip(strZip, strDB)
  21.     End If
  22.     Call Echo(True, """" & strDB & """ compacted.")
  23.     CompactDb = True
  24.     Exit Function
  25.  
  26. ErrorCDB:
  27.     CompactDb = False
  28. End Function
Yes I have seen this code...but thanks for the help as always. For what I was doing it wasn't a big issue because the program is for people that don't know how to use access so it's sorta like a one click function and the Wise Zoraster will answer all of your questions at once...and so after that is done and I clear all the tables I just have it do the compact function from the file menu.
Dec 1 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Jon Ole Hedne | last post by:
I have worked on this problem some hours now (read many-many...), and I can't solve it: In vba-code I create a table with Connection.Execute, and add some data to it. This table is saved in the...
35
by: deko | last post by:
Do I get more scalability if I split my database? The way I calculate things now, I'll be lucky to get 100,000 records in my Access 2003 mdb. Here some math: Max mdb/mde size = 2000 x 1024 =...
14
by: Sonic | last post by:
I have an MDE file that is growing exponentially (from 3,900 KB to over 132,000 KB today). I am not saving data in this MDE, although I use a mix of offline and SQL tables for Read Only querying. ...
7
by: ddsvi78 | last post by:
I am a complete idiot when it comes to access. Now that said, I work for a computer security company and one of our customers came to us with an access problem. They had been running fine for a...
6
by: owengoodhew | last post by:
Hi, I am responsible for maintaining an MS Access 97 Database that reliably becomes corrupt following a compact......... About the Database: The database is made up of three linked databases,...
17
by: DaveG | last post by:
Hi all I am planning on writing a stock and accounts program for the family business, I understand this is likely to take close to 2 years to accomplish. The stock is likely to run into over a...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
9
by: vanlanjl | last post by:
Okay this is very complicated (for me), but i need some help on this please. I am creating a Network Diagram in Visio, along with this I have collected all the Information for every Network Device...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.