Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get path to backup directory of SQL Server
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00859024
Message ID:
00859079
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform