by Daniel Bennington (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (5 Votes)
Allows you to backup a source file and have the destination file name be the current date. Great for database backups!
Assumes
Create a new form, create a field called text1 and a field called text2. Also create a command button called command1.
Change Source directory to your database directory name, change source file name to your database name, and change the destination directory name to the location you want the database file backed up to..
- Put this on form load...
Private Sub Form_Load()
Dim MyDate
MyDate = Format(Date, "dddd, mmm d yyyy")
Text1.Text = "C:\SourceDirectory\SourceFile.mdb"
Text2.Text = "C:\DestinationDirectory\" + MyDate + ".mdb"
- Put this on Command1 Click...
Private Sub Command1_Click()
FileCopy Text1.Text, Text2.Text