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:
00857681
Views:
26
>You could try this as well:
>
>
>LOCAL lcSQLScript, loConnection
>
>loConnection = CREATEOBJECT('ADODB.CONNECTION')
>loConnection.Open("Provider=SQLOLEDB.1;User ID=MyUserName"+;
>	+";PWD=MyPassword"+;
>	+";Persist Security Info=False"+;
>	+";Initial Catalog=MyDatabaseName"+;
>	+";Data Source=MyServerName")
>
>lcSQLScript = ;
>"BACKUP DATABASE [MyDatabase] TO  DISK = N'C:\Backups\BackupFilename' "+;
>"WITH  INIT ,  NOUNLOAD ,  NAME = N'MyBAckupName',  NOSKIP ,  STATS = 10,  "+;
>"DESCRIPTION = N'MyBAckupName',  NOFORMAT "
>
>loConnection.Execute(lcSQLScript)
>
Thank you. Very educational.
What is the significance of those Ns in front of the quotes?

Alex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform