asp 缺少对象 424
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<link rel="stylesheet" href="../css/main.css">
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub btnret_onclick
history.back
End Sub
-->
</SCRIPT>
</HEAD>
<body bgcolor="#a5a5a5" >
<p><strong><font color=red>备份中,请等待...</font></strong></p>
<%
dim msvr,muid,mpwd,mdb,mto
msvr=Request.Form("txtsvr")
muid=Request.Form("txtuid")
mpwd=Request.Form("txtpwd")
mdb=Request.Form("txtdb")
mto=Request.Form("txtto")
if mpwd="" then mpwd=""
on error resume next
Server.ScriptTimeOut=999
set dmosvr=server.CreateObject("SQLDMO.SQLServer")
dmosvr.LoginTimeout=999
dmosvr.connect msvr,muid,mpwd
if err.number>0 then
response.write err.number&"<font color=red><br>"
response.write err.description&"</font>"
end if
Set bak = Server.CreateObject("SQLDMO.Backup")
bak.Database=mdb
bak.Devices=Files
bak.Files="["&mto&"]"
bak.SQLBackup dmosvr
if err.number>0 then
response.write err.number&"<font color=blue><br>"
response.write err.description&"</font>"
response.write "<p align=center><input id=btnret name=btnret type=button value='返回' class=input></p>"
response.End
end if
'mdevname="Backup_"&muid&"_"&mdb
'set dmodev=server.CreateObject("SQLDMO.BackupDevice")
'dmodev.name=mdevname
'dmodev.type=2
'dmodev.PhysicalLocation=mto
'dmosvr.BackupDevices.Add dmodev
'if err.number>0 then Response.Redirect("http:backuperr.asp?err="&err.number)
'set dmobak=server.CreateObject("SQLDMO.Backup")
'dmobak.database=mdb
'dmobak.devices=mdevname
'dmobak.sqlbackup dmosvr
'if err.number>0 then Response.Redirect("http:backuperr.asp?err="&err.number)
'dmosvr.backupdevices(mdevname).remove
'set dmobak=nothing
'set dmodev=nothing
'dmosvr.disconnect
'set dmosvr=nothing
%>
<p><strong><font color=blue>数据库 '<%=mdb%>'备份成功!</strong></font></p>
<p align=center><input id=btnret name=btnret type=button value="返回" class=input></p>
</BODY>
</HTML>
ASP
对象
数据库
------解决方案--------------------把 on error resume next 注释掉再运行,看实际出错的行数
如果是 这句 set dmosvr=server.CreateObject("SQLDMO.SQLServer") 错, 查下注册表有没有SQLDMO.SQLServer, 要装老版本的SQL Server才有