473,421 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

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 2392
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\MSACCESS.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.Application
Private Sub SaveMDBObjectsAsText()
Dim r As Reference
DateTimeString = Format(Now(), "yyyymmddhhnn")
Path = CurrentProject.Path & "\AS_TEXT_" & DateTimeString & "\"
MkDir Path
Set App = New Access.Application
SaveDataAccessPagesAsText
SaveFormsAsText
SaveReportsAsText
SaveModulesAsText
SaveQueriesAsText
SaveMDBBase
LoadDataAccessPagesFromText
LoadFormsFromText
LoadReportsFromText
LoadModulesFromText
LoadQueriesFromText
On Error Resume Next
With App
With .CurrentProject
' disable special keys
' With .Properties
' .Add "AllowByPassKey", False
' .Item("AllowByPassKey").Value = False
' .Add "AllowSpecialKeys", False
' .Item("AllowSpecialKeys").Value = 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 acCmdCompileAndSaveAllModules
.CloseCurrentDatabase
' convert to AC2k
.ConvertAccessProject Path, Replace(Path, "XP.", "."),
acFileFormatAccess2000
' 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 SaveDataAccessPagesAsText()
Dim FileName As String
Dim Name As String
Dim DataAccessPage As AccessObject
For Each DataAccessPage In CurrentProject.AllDataAccessPages
Name = DataAccessPage.Name
FileName = Path & Name & ".txt"
SaveAsText acDataAccessPage, 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 SaveReportsAsText()
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 SaveModulesAsText()
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 SaveQueriesAsText()
Dim FileName As String
Dim Name As String
Dim GetQueryNames As ADODB.Recordset
Set GetQueryNames =
CurrentProject.Connection.OpenSchema(adSchemaViews )
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(CurrentProject.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.OpenCurrentDatabase FileName
End Sub

Private Sub LoadDataAccessPagesFromText()
Dim FileName As String
Dim Name As String
Dim DataAccessPage As AccessObject
For Each DataAccessPage In CurrentProject.AllDataAccessPages
Name = DataAccessPage.Name
FileName = Path & Name & ".txt"
App.LoadFromText acDataAccessPage, Name, FileName
Next DataAccessPage
End Sub

Private Sub LoadFormsFromText()
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.LoadFromText acForm, Name, FileName
Next Form
End Sub

Private Sub LoadReportsFromText()
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.LoadFromText acReport, Name, FileName
Next Report
End Sub

Private Sub LoadModulesFromText()
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.LoadFromText acModule, Name, FileName
Next Module
End Sub

Private Sub LoadQueriesFromText()
Dim FileName As String
Dim Name As String
Dim GetQueryNames As ADODB.Recordset
Set GetQueryNames =
CurrentProject.Connection.OpenSchema(adSchemaViews )
With GetQueryNames
Do While Not .EOF
Name = .Fields("TABLE_NAME")
FileName = Path & Name & ".txt"
App.LoadFromText 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
BTW, is this Fun for the City of New York thing a list of RedHeads?

Dec 1 '05 #11
Lyle,

I think you missed the "d" on the end of our name.

It's a list of DreadHeads. <G>

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

Dec 1 '05 #12

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

Similar topics

36
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...
1
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:...
2
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...
3
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...
7
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
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
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...
3
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,...
45
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...
2
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
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...

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.