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:
00859105
Views:
15
Thank you, Zoran. You have been very helpful.

Alex

>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
>
Previous
Reply
Map
View

Click here to load this message in the networking platform