[asp]代码库
Dim objSQLServer
Set objSQLServer = Server.CreateObject("SQLDMO.SQLServer")
objSQLServer.Connect "Localhost", "sa", ""
Private Sub Backup()
Dim objBackup
Set objBackup = Server.CreateObject("SQLDMO.Backup")
objBackup.Database = "pubs"
objBackup.MediaName = "C:\Mssql7\Backup\pubs.bak"
objBackup.MediaDescription = "Back of pubs"
objBackup.SQLBackup (objSQLServer)
End Sub
Private Sub cmdRestore_Click()
Dim objRestore
Set objRestore = Server.CreateObject("SQLDMO.Restore")
objRestore.Database = "pubs"
objRestore.MediaName = "C:\Mssql7\Backup\pubs.bak"
objRestore.ReplaceDatabase = True
objRestore.SQLRestore (objSQLServer)
End Sub
by: 发表于:2017-11-14 10:33:05 顶(0) | 踩(0) 回复
??
回复评论