How to Refresh Server after Adding Backup Device ?

  • Hi there,

    I have a simple application in VB.NET. On Backup Button, It first add the Backup Device and then it Backup on this device.

    The Problem is when i add a backup Device and when i try to take backup on this device, i get error that "No entry found in sysdevices for this backup device. Update sysdevices and re run this script".

    When i Refresh in SQL Enterprise Manager, the Device is there but how can i Refresh this Progrmatically so that it will find the entry of this newly Backup device.

    I have done like

    dmoserver.backupdevices.refresh()

    dmoserver.databases.refresh()

     

    Thanks for any help or suggestion.

     

     

  • This was removed by the editor as SPAM

  • I didnt see any issue with adding a device and then seeing it show up. This is what I used to test:

     

    Dim oserver As SQLDMO.SQLServer

    Dim oDevice As SQLDMO.BackupDevice

    Dim odevices As SQLDMO.BackupDevices

    Dim oDB As SQLDMO.Database

    oserver =

    New SQLDMO.SQLServer

    oserver.LoginSecure =

    True

    oserver.Connect(".")

    oDevice =

    New SQLDMO.BackupDevice

    oDevice.Name = "Test1"

    oDevice.Type = SQLDMO.SQLDMO_DEVICE_TYPE.SQLDMODevice_DiskDump

    oDevice.PhysicalLocation = "C:\test1.dev"

    oserver.BackupDevices.Add(oDevice)

    For Each oDevice In oserver.BackupDevices

    Console.WriteLine(oDevice.Name, oDevice.PhysicalLocation)

    Next

    oserver.DisConnect()

    oserver =

    Nothing

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply