Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 32,171 times

Contents

Downloads

Related Categories

Using SQL-DMO To Backup and Verify a Database - Overview

Overview

The SQL Distributed Management objects (SQL-DMO) extend the functionality of SQL Server by providing developers a way to execute common tasks using programming and scripting languages. The first article in this series entitled "Using the SQL Distributed Management Objects", provided an overview of SQL-DMO. This article expands upon those concepts by showing you how to use SQL-DMO to create an Active Server Page application to backup and verify a SQL Server database.

What You Will Need

You will need knowledge of how to backup a SQL Server database. Additionally make a reference to the SQL-DMO library in your global.asa file. The below snippet is a reference for SQL Server 2000.

<!--METADATA TYPE="TypeLib" NAME="Microsoft SQLDMO Object Library" UUID="{10010001-E260-11CF-AE68-00AA004A34D5}" VERSION="8.0"-->

The sample application and code snippets will work for SQL 7.0, MSDE, and SQL Server 2000.

Joy and Pain

Working with the SQL-DMO object can be both a joy and pain. It provides you with so much rich functionality it often becomes confusing trying to figure out what properties and methods you really need. On that note, I'm only going to discuss the objects, properties, and methods used within the sample application. You can find unlimited information and code samples in the SQL Server books on-line. You can also download the sample application that accompanies this article. It provides ASP code for all topics covered below.

Comments

  • BACKUP SQL DATABASE in VC++

    Posted by jayender.vs on 06 Jun 2005

    here the solution for Backup the database in VC++:



    int backup::OnButton1()

    {
       HRESULT hr;
       if FAILED(hr = CoInitialize (NULL))
       {
           //_tprintf(TEXT("CoInitialize Failed\n"));
           return...

  • Using SQL-DMO To Backup and Verify a Database

    Posted by vpolv on 29 Jan 2005

    Hi

    I tried your code, seems it is not working for remote database backup.
    do u have any update version for taking backups.

    thanks