用最简单的步骤备份sql数据库的文件到本地:
responseCharset = utf
SessionCodepage =
ResponseBuffer=true
ResponseClear
根据你的情况修改用户名和密码
constr=Provider=SQLOLEDB;Persist Security Info=True;User ID=endiva;Password=endiva;Data Source=
set conn=servercreateobject(adodbconnection)
connopen constr
bkfname=servermappath(Format_Time(Now())&databasebak)
sqlstr=backup database fang to disk=+bkfname+ with init
connexecute sqlstr
connclose
responseWrite database [fang] is backup success!
responseWrite click download
如果想直接备份并下载可以加上下边的这部分就会备份后自动保存但是弹出的文件是asp的文件修改下就OK
set fn=servercreateobject(adodbstream)
fnmode= 读写
fntype= 数据类型为adTypeBinary
fnopen
fnLoadFromFile bkfname 将bkfname指定的文件装入对像中
ResponseContentType=application/octetstream
ResponseBinaryWrite fnread
fnclose