Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to backup database non remote computer?

how to backup database non remote computer?

Scheduled Pinned Locked Moved C / C++ / MFC
databasesql-serversysadminhelpquestion
8 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    venadder
    wrote on last edited by
    #1

    Hi, I am trying to tell MSSQL Server running on a remote computer on LAN to back up a database on my computer. This is done through a application written in c++. The Idea is to back up the database on the computer where the server is located as well as on the computer running the app. What I did before this dual requirement was presented was create a stored procedure to backup the database which took the database name and the location to be backed up to as arguments. It works well as SQL Server backs it on the local drive specified the path. No if I send in the network address of my computer to do the same, SQL SERVER error log tells me that operating system denied permission ( which is what will be expected ). I send in a string as \\computername\driverletter$\path\filename.zip How can I modify this to include the user name and passwrod so that SQL SERVER can back it up on my computer without security problems??? I have tried net use kind of syntax but it does not help. Please help!! this is really important. Thanks In advance. :mad:

    J 1 Reply Last reply
    0
    • V venadder

      Hi, I am trying to tell MSSQL Server running on a remote computer on LAN to back up a database on my computer. This is done through a application written in c++. The Idea is to back up the database on the computer where the server is located as well as on the computer running the app. What I did before this dual requirement was presented was create a stored procedure to backup the database which took the database name and the location to be backed up to as arguments. It works well as SQL Server backs it on the local drive specified the path. No if I send in the network address of my computer to do the same, SQL SERVER error log tells me that operating system denied permission ( which is what will be expected ). I send in a string as \\computername\driverletter$\path\filename.zip How can I modify this to include the user name and passwrod so that SQL SERVER can back it up on my computer without security problems??? I have tried net use kind of syntax but it does not help. Please help!! this is really important. Thanks In advance. :mad:

      J Offline
      J Offline
      John M Drescher
      wrote on last edited by
      #2

      The simplest way is to backup the data on the server and then copy the file to your remote pc using SHFileOperation. John

      V 1 Reply Last reply
      0
      • J John M Drescher

        The simplest way is to backup the data on the server and then copy the file to your remote pc using SHFileOperation. John

        V Offline
        V Offline
        venadder
        wrote on last edited by
        #3

        that will require me to logon to the server computer from the app before attampting the copy won't it?

        J 1 Reply Last reply
        0
        • V venadder

          that will require me to logon to the server computer from the app before attampting the copy won't it?

          J Offline
          J Offline
          John M Drescher
          wrote on last edited by
          #4

          Now when I think of it the user that is logged on has to be an admin for that to work. Sorry. I guess I have worked as an admin too long... There are several ways around this. One way around is you can execute an application as a different user. I have done this in the past. Spawn an application that transfers the file as admin. John

          V 1 Reply Last reply
          0
          • J John M Drescher

            Now when I think of it the user that is logged on has to be an admin for that to work. Sorry. I guess I have worked as an admin too long... There are several ways around this. One way around is you can execute an application as a different user. I have done this in the past. Spawn an application that transfers the file as admin. John

            V Offline
            V Offline
            venadder
            wrote on last edited by
            #5

            I tried using the SHFileOperation function. I gives me an error copying the file which says that error reading the source disk or file. This could be related to security issue, that windows will not let me copy the file from the server to this machine which is running the application. So the original problem is still there. I have the usernames and passwords of both computers(the DBServer and the host running application). How do I backup the DB to host or copy the already backedup file from Server???

            J 1 Reply Last reply
            0
            • V venadder

              I tried using the SHFileOperation function. I gives me an error copying the file which says that error reading the source disk or file. This could be related to security issue, that windows will not let me copy the file from the server to this machine which is running the application. So the original problem is still there. I have the usernames and passwords of both computers(the DBServer and the host running application). How do I backup the DB to host or copy the already backedup file from Server???

              J Offline
              J Offline
              John M Drescher
              wrote on last edited by
              #6

              I know. Unless you are logged in on the local pc as an admin on the server pc SHFileOperation will not work. Sorry. John

              V 1 Reply Last reply
              0
              • J John M Drescher

                I know. Unless you are logged in on the local pc as an admin on the server pc SHFileOperation will not work. Sorry. John

                V Offline
                V Offline
                venadder
                wrote on last edited by
                #7

                but I am logged in as admin !! The problem is how to tell windows that I have admin rights to the server when using the SHFileOperation function??

                J 1 Reply Last reply
                0
                • V venadder

                  but I am logged in as admin !! The problem is how to tell windows that I have admin rights to the server when using the SHFileOperation function??

                  J Offline
                  J Offline
                  John M Drescher
                  wrote on last edited by
                  #8

                  SHFileOperation uses the rights of the logged on user . Are you sure you passed the data correctly? Is your string double null terminated? John

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups