飘凌大杂烩
→
编程技术
→ ASP备份MSSQL数据库
查看完整版本:
ASP备份MSSQL数据库
xiang6963
2008/10/29 13:11:40
<
!
--
#include file
=
"
conn.asp
"
-->
<
%
SQL
=
"
backup database [database] to disk='
"
&
Server.MapPath(
"
backup
"
)
&
"
\
"
&
"
20050901.dat
"
&
"
'
"
'
备份数据库到backup文件夹下,备份文件名为20050901.dat
SQL
=
"
Restore database [database] from disk='
"
&
Server.MapPath(
"
backup
"
)
&
"
\
"
&
"
20050901.dat
"
&
"
'
"
'
恢复备份文件到数据库,备份文件为backup文件夹下的20050901.dat
conn.
execute
SQL
on
error
resume
next
if
err
<>
0
then
response.write
"
错误:
"
&
err.Descripting
else
response.write
"
数据备份并恢复成功!"
end
if
%
>
Powered by
BBSXP 2007 ACCESS
© 1998-2025
Processed in 0.01 second(s)