473,856 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ACC-97 - Great Version Controller/Auto Incremental Backup

Based on MK's TSI_SOON (http://www.trigeminal. com/)I've created a
nifty little procedure that - whenever you compact you db you get an
incremental backup copy.
Given that you have a table with version information you get
incremental backups on a per-version basis.

SEE CODE BELOW

Basic idea is: start TSISOON with the options:
1. "compact this db"
2. Start second db ("AutoCopy.mdb" )
3. Parameter for [Autocopy.mdb fnAutoCopy] is Currentdb.name +
currentversion

AutoCopy.mdb will do a filecopy(curren tdb.mdb, currentdbV101_0 1.mdb)
next compact:
AutoCopy.mdb will do a filecopy(curren tdb.mdb, currentdbV101_0 2.mdb)
next version first compact:
AutoCopy.mdb will do a filecopy(curren tdb.mdb, currentdbV102_0 1.mdb)
etc.

AutoCopy.mdb will finish with a farewell call to TSISOON with option:
1. Start first db ("Currentdb.mdb ")

And we're back in our currentdb, compacted and well with a
state-of-the-art copy
as bonus.

Only I encounter a small hickup during the farewell call to TSISOON:
an Invalid Pagefault in MSVBM60.DLL brings Access on its knees.

Your valued suggestions please.

Suggestion: you can put the code in the form_open proc of an empty
form; load the form from the tool/menubar.

'----------Code for Current.MDB start
Sub PoorMansVersion Control()
'************** *************** *************** ************
' Purpose:
' ========
' Use this sub to Compact your db and create an incremental
' backup at the same time
'
' Prerequisites
' =============
' Prerequisites: your currentdb and an AutoCopy.mdb
'
' HowItWorks:
' ===========
' Prerequisites: your currentdb and an AutoCopy.mdb
' 1. Pass currentdb.name + currentversion to AutoCopy.mdb
' currentversion is in a table called "tblVersion "
' 2. Pass control to AutoCopy (Using TSISOON by MK)
' 3. AutoCopy.mdb will create incremental copy of currentdb
' (based on scanning the current dir for latest incremental copy)
' 4. AutoCopy.mdb passes control back to (read: opens) currentdb
'
' Remarks:
' ========
' The Currentdb holds a table (tblVersion) with version numbers:
' 1.00 initial version
' 1.01 adjusted layout frmOne
' Each time a compact is done; an incremental copy is also created
' Naming of the incremental backups is (suppose we're on version 1.01)
' CurrentdbV101_0 1.mdb
' CurrentdbV101_0 2.mdb
'
'************** *************** *************** *********
' CreatedBy: Willem Pauw, oct 2003
'************** *************** *************** ************
'
'
Dim rs As Recordset
Dim sCurrentDBName As String 'Long name: not 8.3 version
Dim sTableVersion As String
Dim vBackupRoot As Variant 'db-name + tableversion: CurretdbV101
'
'Get Current Versionnumber (1.12, 2.00 etc.)
'
Set rs = CurrentDb.OpenR ecordset("SELEC T * from tblVersie Order By
Versie desc")
sTableVersion = "V" & Left(rs!versie, 1) & Right(rs!versie , 2) '1.12,
2.01 etc
rs.Close
Set rs = Nothing
'
'Prepare Parameter to pass to AutoCopy.mdb
'
sCurrentDBName = fnLongCurrentDB Name
vBackupRoot = Left(sCurrentDB Name, Len(sCurrentDBN ame) - 4) &
sTableVersion

'
'Compact this DB and take a returntrip to AutoCopy.mdb
'
Dim tsd As Object
Set tsd = CreateObject("t sisoon90.connec t80")
With tsd
.FileToOpen = "C:\@Projecten\ AutoCopy.mdb"
.Exclusive = False
.CompactOld = True
.MakeMDE = False
.FunctionToRun = "fnAutoCopy "
.VariantFunctio nArgument = vBackupRoot
.CloseAll Application
End With
Set tsd = Nothing

End Sub
Private Function fnLongCurrentDB Name() As String

Dim sFirstLongNameI nCurrentDir As String
Dim sShortNameOfCur rentDB As String
Dim sPathOfCurrentD B As String
Dim sTemp As String
Dim cTemp As String * 1
Dim i As Integer
'
' Get a random name in current directory
'
With Application.Fil eSearch
.NewSearch
.Filename = DBEngine(0)(0). Name
.MatchTextExact ly = True
.Execute
sFirstLongNameI nCurrentDir = .FoundFiles(1)
End With
Dim intCounter As Integer
'
' Get PathPart of found file
'
For i = Len(sFirstLongN ameInCurrentDir ) To 1 Step -1
If Mid$(sFirstLong NameInCurrentDi r, i, 1) = "\" Then
Exit For
End If
Next i
sPathOfCurrentD B = Left$(sFirstLon gNameInCurrentD ir, i)
'
' Get DBname-part from currentdb
'
sShortNameOfCur rentDB = CurrentDb.Name
For i = Len(sShortNameO fCurrentDB) To 1 Step -1
cTemp = Mid$(sShortName OfCurrentDB, i, 1)
If cTemp <> "\" Then
sTemp = cTemp & sTemp
Else
Exit For
End If
Next i
sShortNameOfCur rentDB = sTemp
'
'Let's glue it together
'
fnLongCurrentDB Name = sPathOfCurrentD B & sShortNameOfCur rentDB

End Function
'----------Code for Current.MDB end
'----------Code for AUTOCOPY.MDB start
Public Function fnAutoCopy(vDat abasenamePlusTb lVersion As Variant)
'************** *************** *************** ************
' Purpose:
' ========
' Based on the passed Parameter this funcion will create
' in incremental copy.
'
' Example
' =======
' Parameter = "CurrentdbV 102"
' Files already present: CurrentdbV101_0 1.mdb and CurrentdbV101_0 2.mdb
' File created this time: CurrentdbV101_0 3.mdb
'
' HowItWorks:
' ===========
' Prerequisites: your currentdb and an AutoCopy.mdb (this mdb)
' 1. Pass currentdb.name + currentversion to AutoCopy.mdb
' currentversion is in a table called "tblVersion "
' 2. Pass control to AutoCopy (Using TSISOON by MK)
' 3. AutoCopy.mdb will create incremental copy of currentdb
' (based on scanning the current dir for latest incremental copy)
' 4. AutoCopy.mdb passes control back to (read: opens) currentdb
'
' Remarks:
' ========
' The Currentdb holds a table (tblVersion) with version numbers:
' 1.00 initial version
' 1.01 adjusted layout frmOne
' Each time a compact is done; an incremental copy is also created
' Naming of the incremental backups is (suppose we're on version 1.01)
' CurrentdbV101_0 1.mdb
' CurrentdbV101_0 2.mdb
'
'************** *************** *************** *********
' CreatedBy: Willem Pauw, oct 2003
'************** *************** *************** ************
Dim sBackupRoot As String
Dim sDIR As String
Dim iVersionNumberO ld As Integer
Dim iVersionNumberC urrent As Integer
Dim iVersionNumberH ighest As Integer
Dim sBackupSource As String
Dim sBackupTarget As String
'
'Check for latest backup
'
sBackupRoot = vDatabasenamePl usTblVersion & "_"
sDIR = Dir(sBackupRoot )
'
'Get the latest version
'
Do While Not sDIR = ""
'
'Check highest version
'
iVersionNumberC urrent = Left(Right(sDIR , 6), 2) '.... _01.mdb ...
_02.mdb etc
If iVersionNumberC urrent > iVersionNumberO ld Then
iVersionNumberH ighest = iVersionNumberC urrent
End If
iVersionNumberC urrent = iVersionNumberO ld
'
sDIR = Dir()
Loop
'
'Create backupcopy with new versionnumber
'
sBackupTarget = sBackupRoot & "_" & Right("0" & iVersionNumberH ighest
+ 1, 2) & ".mdb"
sBackupSource = Left(sBackupRoo t, Len(sBackupRoot ) - 5) & ".mdb"

FileCopy Source:=sBackup Source, destination:=sB ackupTarget
'
'Now jump back to calling db
'
Dim tsd As Object
Stop

Set tsd = CreateObject("t sisoon90.connec t80")
With tsd
.FileToOpen = sBackupSource
.Exclusive = False
.CompactOld = False
.MakeMDE = False
.CloseAll Application
End With
Set tsd = Nothing

End Function
'----------Code for AUTOCOPY.MDB end
Nov 12 '05 #1
0 3152

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

Similar topics

3
2239
by: Paul Sheer | last post by:
I have managed to build Python 2.3.3 with the aCC HP-UX C++ compiler by making a number of one-line changes. (For reasons beyond my control, I am forced to use this compiler and it has no C mode at all.) Typically to get the Python source code to compile under aCC one has to make a number of trivial changes of the form, struct whatzit *p; - p = malloc (sizeof (struct whatzit));
4
5878
by: rpmohan | last post by:
Hello, I have sample Program called sample.C . The source code looks like below. #include <List.h> int main(int argc, char *argv) { List<int> myList; return 0;
4
3142
by: zzfreddybb | last post by:
We are using HP aCC compiler on a HP Itanium box ( 11.23) We are having some severe performance hits using exception handling ( try/catch ) scenarios. The online aCC documentation says: HP aC++ exception handling has no significant performance impact at compile-time or run-time. We have not found this to be the case at all.
0
1506
by: mbpradeep | last post by:
Hello all, I am compiling a C++ application with aCC (LP64 model - +DD64). But we are using some non standard includes like (/opt/aCC/include/SC - standard components) Time.h (note capital "T") and String.h etc. I could compile the same code in 32 bit by linking with lib++.a. But I am not able to link 64 bit code with existing lib++.a (/opt/aCC/lib/lib++.a) - obviously may be due to differences in the architechure. But I could not find...
10
2999
by: vd12005 | last post by:
hello, i'm wondering how people from here handle this, as i often encounter something like: acc = # accumulator ;) for line in fileinput.input(): if condition(line): if acc: #1 doSomething(acc) #1
0
1100
by: musathiyan | last post by:
Hello, I am trying to port a code module from CC compiler to aCC compiler. This raises the following errors: Error 173: "/opt/aCC/include_std/limits", line 694 # Redefined symbol 'numeric_limits<int>'; previously defined at . _RWSTD_SPECIALIZE_LIMITS (bool, int, _RWSTD_BOOL)
5
1659
by: Mike | last post by:
Hi, We are pleased to announce the release of AspeCt-oriented C (ACC) V 0.6. The ACC 0.6 release includes some experimental features and a new script "tacc" for automatically integrating aspect-compilation in building large C-based software projects. For more details and download, please visit http://www.aspectc.net.
0
1283
by: Mike | last post by:
We are pleased to announce the release of AspeCt-oriented C (ACC) V 0.7. The ACC 0.7 release includes two main experimental features: The variable set() and get() pointcut. For more details and to download, please visit http://www.aspectc.net. Highlights of ACC V 0.7 include:
1
2194
by: nsarkar | last post by:
Hello Friends, We are using HPU (B.11.23 U 9000/800 908196403), and aCC (HP ANSI C++ B3910B A.03.70), and it is regarding a warning we got at the time of compiling our C++ Application. ---------------------- Warning 849: Exact position unknown; near . # External symbol too long, truncated from 4185 to 4000 bytes,erase__Q2_4__rw9__rb_treeXTQ2_3std12basic_stringXTcTQ2_3std11char_traitsXTc
0
1134
by: Z | last post by:
We have a bunch of access add-ins that we created in acc 2000. Trying to upgrade to acc 2007 but we can't seem to get the add-ins to work. Is there a equivalent to the USYSREGINFO? We can't even find the table (or any system tables) when we open the original myaddin.mda in acc 2007. If there is a different way to register it, anyone know how? We were able to find the add-in manager and add the add-in. Could not
0
11057
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
10696
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10782
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10384
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
7932
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
7094
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
5761
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...
0
5958
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4575
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

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.