I have just come back to coding after a break of 12 months, as you know remebering wat u knew can be hard, i created a macro or code that compressed another database (renamed to temp, then copied back to original name) so that the user could maintain the size as required but for the life of me i cant find the file i created, can u help please.
5 2498 NeoPa 32,556
Expert Mod 16PB
Are you asking for help finding a file stored on your system?
If not, I'm not sure what you mean.
Perhaps you could clarify.
Are you asking for help finding a file stored on your system?
If not, I'm not sure what you mean.
Perhaps you could clarify.
No sorry, just that if you know the method / code that allows me to compact another file from a macro / database, i.e compact closed file A from code within open file B. hope this helps explain what i need.
NeoPa 32,556
Expert Mod 16PB
I've got you.
I'll post it here when I've found it - shouldn't be too long.
NeoPa 32,556
Expert Mod 16PB
This is an example function that I use. - 'CompactDb compacts a remote Access database.
-
Public Function CompactDb(ByVal strDB As String, _
-
Optional strPW As String = "") As Boolean
-
Dim strNewDB As String, strLocale As String
-
-
On Error GoTo ErrorCDB
-
strNewDB = Replace(strDB, ".Mdb", "New.Mdb")
-
Call Echo(True, "Compacting '" & strDB & "'.")
-
If strPW <> "" Then strLocale = ";pwd=" & strPW
-
If Exist(strNewDB) Then Kill strNewDB
-
Call DBEngine.CompactDatabase(SrcName:=strDB, _
-
DstName:=strNewDB, _
-
DstLocale:=strLocale, _
-
SrcLocale:=strLocale)
-
Kill strDB
-
Name strNewDB As strDB
-
Call Echo(True, "'" & strDB & "' compacted.")
-
CompactDb = True
-
Exit Function
-
-
ErrorCDB:
-
CompactDb = False
-
End Function
-
-
'Exist returns true if strFile exists.
-
'22/05/2003 Rewritten with better code.
-
'20/05/2005 Added finding of R/O, System & Hidden files
-
Public Function Exist(strFile As String, _
-
Optional intAttrib As Integer = &H7) As Boolean
-
Exist = (Dir(PathName:=strFile, Attributes:=intAttrib) <> "")
-
End Function
This is an example function that I use. - 'CompactDb compacts a remote Access database.
-
Public Function CompactDb(ByVal strDB As String, _
-
Optional strPW As String = "") As Boolean
-
Dim strNewDB As String, strLocale As String
-
-
On Error GoTo ErrorCDB
-
strNewDB = Replace(strDB, ".Mdb", "New.Mdb")
-
Call Echo(True, "Compacting '" & strDB & "'.")
-
If strPW <> "" Then strLocale = ";pwd=" & strPW
-
If Exist(strNewDB) Then Kill strNewDB
-
Call DBEngine.CompactDatabase(SrcName:=strDB, _
-
DstName:=strNewDB, _
-
DstLocale:=strLocale, _
-
SrcLocale:=strLocale)
-
Kill strDB
-
Name strNewDB As strDB
-
Call Echo(True, "'" & strDB & "' compacted.")
-
CompactDb = True
-
Exit Function
-
-
ErrorCDB:
-
CompactDb = False
-
End Function
-
-
'Exist returns true if strFile exists.
-
'22/05/2003 Rewritten with better code.
-
'20/05/2005 Added finding of R/O, System & Hidden files
-
Public Function Exist(strFile As String, _
-
Optional intAttrib As Integer = &H7) As Boolean
-
Exist = (Dir(PathName:=strFile, Attributes:=intAttrib) <> "")
-
End Function
Many thanks - i appreciate your help and expertise
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tony |
last post by:
Hello,
Any assistance would be appreciated:
As the subject suggests I am trying to gunzip files using the
Compress::Zlib module. The following is basically the code that I am
working with:
...
|
by: Matt Kruse |
last post by:
I am far from a PHP expert, and I've been struggling to create a function
which will take a javascript .js file and "compact" it as much as possible.
Meaning, remove all comments and unnecessary...
|
by: Sue |
last post by:
For lob data is it a good idea to both compact and apply system
compression? I understand compact can reduce performance when updating
but any disadvantages of using compress? Will it help to save...
|
by: smitty mittlebaum |
last post by:
I have a strange problem that has reared its ugly head in the last few
weeks.
I have the option "Compact on Close" (Tools, Options, General tab)
enabled on my development machine. I did this...
|
by: MLH |
last post by:
I just used Tools / Database Utilities / Compact Database
in Access 97 for the first time. Unlike Access 2.0, it does
not ask me to furnish a filename for it to compact into.
It just launched...
|
by: Champika Nirosh |
last post by:
Hi,
I have two machine where I needed to have a extended TCP/IP protocol to make
the link between the two machines
Mean,I need to write a application that compress every data the machine send...
|
by: Ron |
last post by:
New discovery.
If I take a perfectly good database, and "compact/repair" on it with Access
2000 (seems to be at multiple sites--I've tried it with my system here, at
another office on an...
|
by: Neil |
last post by:
I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file size
and then perform the compact through code as the...
|
by: OldBirdman |
last post by:
Access has an option for Compact on Close. Very good, as that should stop a major increase in size every time any .mdb file is used by Access.
My question is, Is this safe? It used to be that I...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |