>Dear Experts
>
>I am using SQLSERVER 2008 R2.
>
>Want to send backup from server to client
>For this I am trying this code
>
>
>filename='accounts'
>mdest2='\\Sales\d'
>target1=ALLTRIM(mdest2)+ALLTRIM("\")+ALLTRIM(filename)+ALLTRIM(".bak")
>
>MESSAGEBOX("Backup path is"+CHR(13)+target1,0+64,"SQLSERVER")
>nresult=SQLEXEC(m.con,"backup database &filename to disk='target1'")
>
>IF nresult<0
> MESSAGEBOX('Backup Faild-1',0+64,'Backup')
> RETURN
>ELSE
> MESSAGEBOX("Done")
>ENDI
>
>
>
>but it says:
>Backup Faild-1
>
>Please help
Start from doing the backup in SSMS. Script the operation. Then use that script for your command from VFP.
Right now your code makes very little sense.
Also, keep in mind that when you're performing a backup on the server, the server can only access itself and not the user's computer.
If it's not broken, fix it until it is.
My Blog