CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Restore Database from a Remote Backup

    Good Day All

    am restoring a Database Programatically in Sql. Now if the backup is located in the remote machine i use a Share

    \\Vuyiswa\MyShare\


    but i will get the Following Error

    Exception caught in: ExecuteStoredProc: The file "\\Vuyiswa\Databases\\REmoteTest33.mdf" is on a network path that is not supported for database files. File 'TNGoedit_Data' cannot be restored to '\\Vuyiswa\Databases\\REmoteTest33.mdf'. Use WITH MOVE to identify a valid location for the file. The file "\\Vuyiswa\Databases\\REmoteTest33_log.ldf" is on a network path that is not supported for database files. File 'TNGoedit_Log' cannot be restored to '\\Vuyiswa\Databases\\REmoteTest33_log.ldf'. Use WITH MOVE to identify a valid location for the file. Problems were identified while planning for the RESTORE statement. Previous messages provide details. RESTORE DATABASE is terminating abnormally. Database 'REmoteTest33' does not exist. Make sure that the name is entered correctly.



    Thanks
    Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Restore Database from a Remote Backup

    I have never tried it with code, however you can try using the devices rather than directly giving the location. Something similar to this
    Code:
    USE master
    GO
    RESTORE DATABASE MYDATABASE   FROM TAPE = '\\Vuyiswa\MyShare\'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured