Back up the database with SQL-DMO and check

zhaozj2021-02-16  43

This article talks about how to create database backups and check in SQL-DMO.

============================================================================================================================================================================================================= ==========

Overview SQL Distributed Management Objects (SQL-DMO) provides developers with a method of performing normal tasks using programs and scripting languages, thereby expanding SQL Server features. This article talks about how to create database backups and check in SQL-DMO.

Prerequisites you need to have relevant knowledge of SQL Server database backup. Also add references to the SQL-DMO library in the global.asa file. The following is a reference to SQL Server 2000:

This example code applies to SQL 7.0, MSDE, and SQL Server 2000.

Hi and worry use SQL-DMO objects and worry. It provides a very rich function that I don't know how to use it. This article only discusses the object properties and methods involved in the example. You can find a lot of information in SQL Server online teaching. This article can be downloaded at the end of this paper.

SqldMo.sqlserver code looks very familiar. It is used to connect SQL Server databases: <% DIM SRV SET SRV = Server.createObject ("SqldMo.sqlServer") srv.logintimeout = 15 srv.connect "Servername", "UserName", "Password"%>

Here, connect the SQL Server database by giving the username and password. If you want to use NT authentication, set its loginsecure property to true (TRUE), ignore the amount of username and password, and use NT's registration information.

SqldMo.database lists the databases in the server. In this example, the listed database is backed up. The following code lists the database in the server to the drop-down menu: <% DIM SRV DIM OBJDB SET SRV = Server.createObject ("SqldMo.sql Server") srv.logintimeout = 15 srv.connect "ServerName", "UserName", "Password "Set objdb = server.createObject (" sqldmo.database ")%>

CopyRight © 2020 All Rights Reserved
Processed: 0.046, SQL: 9