用最簡單的步驟備份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
From:http://tw.wingwit.com/Article/program/SQL/201311/16162.html