I have logging prograam for Ham Radio I am working on Need help with numbering backups

  • Thread starter Thread starter Medic_Mike63
  • Start date Start date
M

Medic_Mike63

Guest
I am writing a Amatuer Radio Logging program I have a backup sub routine that will back up my database's and makes them unique with the date and time of backup.

What I would really like is to number them consecuativly so you can easily see the oldest to newest.

Here is my code that works

Try
'set the destination and a file name with the date and time
Dim backupfiledestination1 As String = "C:\RRLogger Data\Backups\County Hunter - " & lblCall.Text & Format(Now(), " yy-M-d H m s") & ".accdb"
Dim backupfiledestination2 As String = "C:\RRLogger Data\Backups\County Hunters - common" & Format(Now(), " yy-M-d H m s") & ".accdb"
'location of the database file that you want to backup
Dim databaseFile1 As String = "C:\RRLogger Data" & "\County Hunter - " & lblCall.Text & ".accdb"
Dim databaseFile2 As String = "C:\RRLogger Data" & "\County Hunters - common" & ".accdb"

'create a backup by using Filecopy Command to copy the file from location to destination
FileCopy(databaseFile1, backupfiledestination1)
FileCopy(databaseFile2, backupfiledestination2)
MsgBox("Database Backup has been Created Successfully!")


Catch ex As Exception
'catch an error
MsgBox(ex.Message)

End Try

the above code leaves a file.................. County Hunter - K8EMS 20-1-13 16 21 33.accdb

County Hunter - K8EMS 20-1-13 15 21 30.accdb


I would like it to look Like......County Hunter - K8EMS - Bak1.accdb

County Hunter - K8EMS - Bak2. accdb and so forth

any help would be appreciated I looked for the last 2 days and could not find an example for doing this.


THANK YOU in advance


medic_Mike63

Continue reading...
 
Back
Top