Hello everyone,
I am using the following code (which i got by using the search function in the website":
My question is where and how to set a reference to the 'Microsoft Scripting runtime'?
Iam a beginner so please bear with me..
Di7bash
I am using the following code (which i got by using the search function in the website":
Code:
Public Function BackupCopy()
'This function will allow you to copy a db that is open,
'You must set a reference to the 'Microsoft Scripting Runtime' for the CopyFile piece to work!
Dim fso As FileSystemObject
Dim sSourcePath As String
Dim sSourceFile As String
Dim sBackupPath As String
Dim sBackupFile As String
sSourcePath = "C:\Database\"
sSourceFile = "MyDB.mdb"
sBackupPath = "C:\Database\Backups\"
sBackupFile = "BackupDB_" & Format(Date, "mmddyyyy") & "_" & Format(Time, "hhmmss") & ".mdb"
Set fso = New FileSystemObject
fso.CopyFile sSourcePath & sSourceFile, sBackupPath & sBackupFile, True
Set fso = Nothing
Beep
MsgBox "Backup was successful and saved @ " & Chr(13) & Chr(13) & sBackupPath & Chr(13) & Chr(13) & "The backup file name is " & Chr(13) & Chr(13) & sBackupFile, vbInformation, "Backup Completed"
End Function
My question is where and how to set a reference to the 'Microsoft Scripting runtime'?
Iam a beginner so please bear with me..
Di7bash