Results 1 to 3 of 3

Thread: I found this module and have 3 instances and I do not know how to call the module.

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2001
    Location
    Calgary
    Posts
    273

    I found this module and have 3 instances and I do not know how to call the module.

    Hi guys, I'm asking for help with a module that module supposed to backup data from SQL and later restore it to the same location.

    Thank you to all of you guys, blessings.

    I found this module, which I had to modify for my application, but I stopped when I tried to call the module. I tried in three different ways, and I can't get it to run.
    I know the simple module, but this one is more difficult. I would appreciate it if one of you could help me.
    Code:
    Module Program
        Sub Main()
            Dim connectionString As String = "Server = localhost \ SQLEXPRESS;Database=master;Trusted_Connection=True;"
            Dim databaseName As String = "citas"
            Dim backupFilePath As String = "C:\CitasBackRes\To\BackupFile.bak"
    
            Dim dbManager As New DatabaseBackupRestore()
    
            ' Backup the database
            dbManager.BackupDatabase(connectionString, databaseName, backupFilePath)
    
            ' Restore the database
            dbManager.RestoreDatabase(connectionString, databaseName, backupFilePath)
        End Sub
    End Module
    Module MainModule
        Private BackupDatabase As Object
    
        Sub Program()
            ' Call the subroutine without specifying the namespace
            BackupDatabase.dbmanager()
        End Sub
    End Module
    Last edited by Shaggy Hiker; May 24th, 2025 at 10:13 PM. Reason: Added CODE tags.
    mannyso

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width