Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get path to backup directory of SQL Server
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00859024
Message ID:
00859079
Vues:
14
Alex,

Maybe this will help:
local loserver, lnCounter, loBackupDevice

loserver=CREATEOBJECT("SQLDMO.SqlServer")

loServer.Connect("MyServer","MyUserName","MyPassword")

   IF loServer.BackupDevices.Count = 0
       * Create new backup device
       loBackupDevice = CREATEOBJECT("SQLDMO.BackupDevice")
       WITH loBackupDevice
           .Name = "MyNewBackupDevice"
           .PhysicalLocation = "C:\MyBackups\BackupFile.bak"
           .Type = 2 && SQLDMODevice_DiskDump
       ENDWITH
       loServer.BackupDevices.Add(loBackupDevice)
   ELSE
       * loop through collection of existing backup devices 
       FOR lnCounter = 1 TO loServer.BackupDevices.Count
   	    ? loServer.BackupDevices(lnCounter).PhysicalLocation
       NEXT lnCounter
   ENDIF
Cheers,

Zoran

>Is there a way to determine programatically, without checking the registry, the path to the BACKUP directory of the (local) SQL server?
>
>TIA,
>
>Alex
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform