473,802 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stubborn front-end bloat in Access 2002

I'm working on an application in Access 2002, and every time I'm done making
changes in the VBA project, the database is noticeably larger after
compacting, even when code changes are small or even if they involve removing
more code than I add.

In the past, I've usually been able to recover space in these situations by
decompiling the front-end, but in this case, after I decompile, compact,
recompile, and compact again, the database has bloated even larger. The
database is now over half again the size it was a few months ago, and the
added content over that time probably represents about a 2 or 3% increase.

Any ideas?
Nov 29 '05 #1
11 2421
I have no ideas as to why, except that sometimes Access seems to save
ugly things (that it created all by itself) in its secret vault, and
its very difficult to find them, much less get rid of them.

Have you tried the old
SaveAsText
LoadFromText (into a new file)
for all objects
trick?

I can send to you or post code that should do it all for you with
minimum pain if you think you might like to go that way.

Nov 29 '05 #2
On 29 Nov 2005 04:52:28 -0800, "Lyle Fairfield" <ly***********@ aim.com> wrote:
I have no ideas as to why, except that sometimes Access seems to save
ugly things (that it created all by itself) in its secret vault, and
its very difficult to find them, much less get rid of them.

Have you tried the old
SaveAsText
LoadFromText (into a new file)
for all objects
trick?

I can send to you or post code that should do it all for you with
minimum pain if you think you might like to go that way.


I know how to do those things. Unfortunately, this database also uses
user/workgroup security, so permissions will also have to be rebuilt.
Nov 29 '05 #3
Ted
I would try to "decompile" your application, then recompiling it.
That seems to clear up a bunch of things.
Here is the command I use to start Access. Then I open the file I want
to work on.
Just modify the command for your version of Office and Access (change
the command to point to your MSACCESS.EXE file).
"C:\Program Files\Microsoft Office 2003\OFFICE11\M SACCESS.EXE"
/decompile
Ted
Steve Jorgensen wrote:
On 29 Nov 2005 04:52:28 -0800, "Lyle Fairfield" <ly***********@ aim.com> wrote:
I have no ideas as to why, except that sometimes Access seems to save
ugly things (that it created all by itself) in its secret vault, and
its very difficult to find them, much less get rid of them.

Have you tried the old
SaveAsText
LoadFromText (into a new file)
for all objects
trick?

I can send to you or post code that should do it all for you with
minimum pain if you think you might like to go that way.


I know how to do those things. Unfortunately, this database also uses
user/workgroup security, so permissions will also have to be rebuilt.


Nov 29 '05 #4
Lyle,

I'm actually about to do that to a database of mine, because it's been
giving intermitent corruption problems. If you don't mind, I'd love it
if you could post that code here.

Thanks much.

Jeremy
--
Jeremy Wallace
Fund for the City of New York

Nov 29 '05 #5
Yikes ... it's with a great deal of trepidation that I post this but I
suppose the worst it can do is completely destroy your database,
permanently all data from your hard drive and burn down your house.
Maybe you should try it on some innocuous copy? And I don't know about
permissions which is an issue that Steve raises. This was written for
XP; it works in 2003. It won't work in 97. 2000 ... I dunno. There's
another virgin for ADPs.

Dim Path As String
Dim DateTimeString As String
Dim App As Access.Applicat ion
Private Sub SaveMDBObjectsA sText()
Dim r As Reference
DateTimeString = Format(Now(), "yyyymmddhh nn")
Path = CurrentProject. Path & "\AS_TEXT_" & DateTimeString & "\"
MkDir Path
Set App = New Access.Applicat ion
SaveDataAccessP agesAsText
SaveFormsAsText
SaveReportsAsTe xt
SaveModulesAsTe xt
SaveQueriesAsTe xt
SaveMDBBase
LoadDataAccessP agesFromText
LoadFormsFromTe xt
LoadReportsFrom Text
LoadModulesFrom Text
LoadQueriesFrom Text
On Error Resume Next
With App
With .CurrentProject
' disable special keys
' With .Properties
' .Add "AllowByPassKey ", False
' .Item("AllowByP assKey").Value = False
' .Add "AllowSpecialKe ys", False
' .Item("AllowSpe cialKeys").Valu e = False
' End With
Path = .FullName
End With

For Each r In .References
With r
If Not .BuiltIn Then
App.References. Remove r
End If
End With
Next r

For Each r In References
With r
If Not .BuiltIn Then
App.References. AddFromGuid r.Guid, r.Major, r.Minor
End If
End With
Next r

.RunCommand acCmdCompileAnd SaveAllModules
.CloseCurrentDa tabase
' convert to AC2k
.ConvertAccessP roject Path, Replace(Path, "XP.", "."),
acFileFormatAcc ess2000
' make mde
' .SysCmd 603, Path, Replace(Path, ".mdb", ".mde")
.Quit
End With
Set App = Nothing
MsgBox "All Done with Text Backup"
End Sub

Private Sub SaveDataAccessP agesAsText()
Dim FileName As String
Dim Name As String
Dim DataAccessPage As AccessObject
For Each DataAccessPage In CurrentProject. AllDataAccessPa ges
Name = DataAccessPage. Name
FileName = Path & Name & ".txt"
SaveAsText acDataAccessPag e, Name, FileName
Next DataAccessPage
End Sub

Private Sub SaveFormsAsText ()
Dim FileName As String
Dim Name As String
Dim Form As AccessObject
For Each Form In CurrentProject. AllForms
Name = Form.Name
FileName = Path & Name & ".txt"
SaveAsText acForm, Name, FileName
Next Form
End Sub

Private Sub SaveReportsAsTe xt()
Dim FileName As String
Dim Name As String
Dim Report As AccessObject
For Each Report In CurrentProject. AllReports
Name = Report.Name
FileName = Path & Name & ".txt"
SaveAsText acReport, Name, FileName
Next Report
End Sub

Private Sub SaveModulesAsTe xt()
Dim FileName As String
Dim Name As String
Dim Module As AccessObject
For Each Module In CurrentProject. AllModules
Name = Module.Name
FileName = Path & Name & ".txt"
SaveAsText acModule, Name, FileName
Next Module
End Sub

Private Sub SaveQueriesAsTe xt()
Dim FileName As String
Dim Name As String
Dim GetQueryNames As ADODB.Recordset
Set GetQueryNames =
CurrentProject. Connection.Open Schema(adSchema Views)
With GetQueryNames
Do While Not .EOF
Name = .Fields("TABLE_ NAME")
FileName = Path & Name & ".txt"
SaveAsText acQuery, Name, FileName
.MoveNext
Loop
End With
End Sub

Private Sub SaveMDBBase()
Dim FileName As String
Dim Name As String
Name = Replace(Current Project.Name, CurrentProject. Path, "")
' name it with XP sffix to enable later conversion to 2K
Name = Replace(Name, ".", "XP.")
FileName = Path & Name
SaveAsText 6, "", FileName
App.OpenCurrent Database FileName
End Sub

Private Sub LoadDataAccessP agesFromText()
Dim FileName As String
Dim Name As String
Dim DataAccessPage As AccessObject
For Each DataAccessPage In CurrentProject. AllDataAccessPa ges
Name = DataAccessPage. Name
FileName = Path & Name & ".txt"
App.LoadFromTex t acDataAccessPag e, Name, FileName
Next DataAccessPage
End Sub

Private Sub LoadFormsFromTe xt()
Dim FileName As String
Dim Name As String
Dim Form As AccessObject
For Each Form In CurrentProject. AllForms
Name = Form.Name
FileName = Path & Name & ".txt"
App.LoadFromTex t acForm, Name, FileName
Next Form
End Sub

Private Sub LoadReportsFrom Text()
Dim FileName As String
Dim Name As String
Dim Report As AccessObject
For Each Report In CurrentProject. AllReports
Name = Report.Name
FileName = Path & Name & ".txt"
App.LoadFromTex t acReport, Name, FileName
Next Report
End Sub

Private Sub LoadModulesFrom Text()
Dim FileName As String
Dim Name As String
Dim Module As AccessObject
For Each Module In CurrentProject. AllModules
Name = Module.Name
FileName = Path & Name & ".txt"
App.LoadFromTex t acModule, Name, FileName
Next Module
End Sub

Private Sub LoadQueriesFrom Text()
Dim FileName As String
Dim Name As String
Dim GetQueryNames As ADODB.Recordset
Set GetQueryNames =
CurrentProject. Connection.Open Schema(adSchema Views)
With GetQueryNames
Do While Not .EOF
Name = .Fields("TABLE_ NAME")
FileName = Path & Name & ".txt"
App.LoadFromTex t acQuery, Name, FileName
.MoveNext
Loop
End With
End Sub

Nov 29 '05 #6
Backups? We don't need no stinkin' backups!

Thanks, Lyle. I promise to use with caution, and to report back here
only if I have exceedingly good news to report on how things went.

Jeremy
--
Jeremy Wallace
Fund for the City of New York

Nov 29 '05 #7
Just an update...

The client opened the database in Access 2003, ran repair & compact, and it
shrunk right down to 1/3 of its previous size. Worst case, if it resumes
bloating again, I'll just have the client compact it for me every few months
or upgrade my Access to 2003.

On Tue, 29 Nov 2005 01:35:12 -0800, Steve Jorgensen <no****@nospam. nospam>
wrote:
I'm working on an application in Access 2002, and every time I'm done making
changes in the VBA project, the database is noticeably larger after
compacting, even when code changes are small or even if they involve removing
more code than I add.

In the past, I've usually been able to recover space in these situations by
decompiling the front-end, but in this case, after I decompile, compact,
recompile, and compact again, the database has bloated even larger. The
database is now over half again the size it was a few months ago, and the
added content over that time probably represents about a 2 or 3% increase.

Any ideas?


Nov 30 '05 #8
Lyle,

Looks like it worked. There were a few tweaks I made for my purposes,
but this was definitely helpful.

Hopefully the testing we'll do over the next couple of weeks won't turn
up any more instances of what was an intermittent PITA.

Thanks so much.

Jeremy
--
Jeremy Wallace
Fund for the City of New York

Dec 1 '05 #9
Fabulous!

Dec 1 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
5324
by: Digital Puer | last post by:
Hi, suppose I have an unsigned long long. I would like to extract the front 'n' bits of this value and convert them into an integer. For example, if I extract the first 3 bits, I would get an int between 0 and 7 (=2^3-1). Could someone please help out? I can assume the largest returned value fits in an int. Also, I'm on a big-endian PPC (AIX), in case that matters. Ideally, I'd like to implement a prototype like: int...
1
2200
by: NGM | last post by:
Hello All When implementing FrontController sample MSDN I am facing a lot of problems try implementing the front controller patterm sample provided by microsoft: (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp) The irony of microsoft asp.net sample is it does not work...and the WORKAROUND as they say it is provide in article...
2
1943
by: Alok Jain | last post by:
Hi, We are using Front Controller implementation in our DotNet application. I am trying to hide URL in my application. This is based on Front Controller model. I am able to achieve if I do not use postback in ASP.Net control. If I post back from a ASP.Net control it takes me to the correct page and the URL is displaeyd as it is.
3
2479
by: Ashish | last post by:
Is anyone aware of a good Front Controller Pattern implementation in ASP.Net, we are developing a new product, and contemplating whether we should use Front Controller Pattern implementation, due to the flexiblity it provides for navigation and loading views etc.... any pointers/comments would be appreciated. regards -ashish
7
2100
by: Abhishek Saksena | last post by:
Hi all, Can somebody help me what the bhaviour of front method on an empty map. For some reason calling front on an empty map seems to work with gcc compiler but not with .NET. Abhishek
6
2690
by: eight02645999 | last post by:
hi wish to ask a qns on strip i wish to strip all spaces in front of a line (in text file) f = open("textfile","rU") while (1): line = f.readline().strip() if line == '': break print line
5
25029
by: Iain Bishop | last post by:
I have a simple form with 4 command buttons and 1 label. The label is sometimes visible and sometimes not. When it is visible I want it to be in front of the buttons. I've tried bringing the label to the front and sending the buttons to the back. In design view the form looks fine, but whenever I open the form the label is behind the buttons. Has anyone else experienced this and know the solution? Is this a known fault? I wouldn't think...
3
6922
by: John | last post by:
What is the easiest way to make the contact form show on the front page. Meaning on want to keep the front html page and when someone clicks on the contact us link the front page remains the same, but there is a contact form in the middle of the page. Any help would be appreciated. - John
45
2289
by: alertjean | last post by:
Or may be I am stubborn or dumb ... of not putting in a * in the typecast. This is code I am worrying about long long b=1; int *address ; address=(int)&b; printf ("%x %x \n",*(address+1)*address); when I compile the code I get this warning from gcc (although it
2
4072
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I asked here yesterday about bringing a form to front with hotkey while using different application then mine (meaning, when i'm using outlook, and pressing ALT+T it will bring a form from my application to front), my problem was that after i press the hotkey, the window stays in minimize state instead of being in the front. i fount an article in google explaining (i think) how to solve this problem, but i couldn't understand what...
0
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10535
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10061
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
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.