Can an Ms Access database create a backup of itself while it's open using vba?

后端 未结 3 1944
迷失自我
迷失自我 2020-12-07 04:51

Background: I have a process that links Quickbooks to Ms Access. If a button is pressed, some information will be queried from Quickbooks and then updates M

3条回答
  •  既然无缘
    2020-12-07 05:10

    You can try using FileSystemObject like this:

        'strFrom = Application.CurrentProject.FullName
        'strTo = "C:\FolderName\NewFileName.accdb"
    
    Public Sub copyFile(strFrom As String, strTo As String)
        Dim fso As FileSystemObject
        Set fso = New FileSystemObject
    
        fso.copyFile strFrom, strTo
    
        Set fso = Nothing
    
    End Sub
    

提交回复
热议问题