backup the db remotely via vb6

Posted on 2006-05-04
Last Modified: 2012-08-13
Backup the database from remotely

Sometime users will need to send us their backup so we can review their data or fix it. It has been done for years using MS Access and we are now migrating over to MS SQL.  Is it there syntax or something that I can write in VB6 to copy the database to the user machine then zip it up? In the past all we had to do was zip up the mdb file and this was possible because mdb file has to be in shared folder out on the server.

I am open to any suggestions.
Question by:lunchbyte
    LVL 28

    Expert Comment

    You can create a backup of a SQL Server by running a TSQL command:

    sSQL = "BACKUP DATABASE [databasename] TO DISK='C:\temp\backup.bak'"
    Connection.Execute(sSQL), , 128

    LVL 5

    Author Comment

    That backup the db on the server but I need it to backup on the local computer.
    LVL 28

    Accepted Solution

    Create a share on the server where the backups are created, and users can get it from there. You have it in a file (just like the Access file), and you knew how to deal with that. Use the same procedure.
    LVL 75

    Expert Comment

    by:Anthony Perkins
    In general, it is not recommended to backup (not to mention difficult to accomplish) using the standard SQL Backup.  You are better off doing a backup to the server and then copying the backup to the local drive.  Assuming you have permissiong, that is.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now