Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple VFP program to backup SQL Server database
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00857511
Message ID:
00857597
Views:
20
>I need to write a simple VFP program for routine backup of a SQL Server database.
>
>User should only choose database, if more than one, and enter a password. Backup path and name and the rest of the process should be automatic.
>
>Can someone help? Thank you.
>
>Alex

Alex,

You could try something like this:
LOCAL loServer, loBackup

loServer   = CREATEOBJECT('SQLDMO.SqlServer')
loServer.Connect("MyServerName","MyUserName", "My password")

loBackup = CREATEOBJECT('SQLDMO.Backup')
WITH loBackup
	.Database   		= "MyDatabaseName"
	.Files      		= '[C:\Backups\BackupFileName]'
	.Initialize 		=  .T.
	.BackupSetName 		= "My Backup"
	.BackupSetDescription = "Mt description"
	.SQLBackup(loServer)
ENDWITH
Cheers,

Zoran
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform