|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
对用户来说可预见费用、节约费用,可以做到花少钱办大事。由于省去了购买软件和硬件等的前期费用,用户可以租用较高级的应用软件。ASP的收费是根据软件的类型、客制化程度、用户数量、服务期限来定的,对客户来说这笔费用是可以预见的。方便于客户应用软件的升级。server|备份|恢复|数据|数据库<HTML><HEAD><TITLE>SQLServer数据库的备份与恢复</TITLE><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"></HEAD><BODY><formmethod="post"name=myform>选择操纵:<INPUTTYPE="radio"NAME="act"id="act_backup"value="backup"><labelfor=act_backup>备份</label> <INPUTTYPE="radio"NAME="act"id="act_restore"value="restore"><labelfor=act_restore>恢复</label><br>数据库名:<INPUTTYPE="text"NAME="databasename"value="<%=request("databasename")%>"><br>文件路径:<INPUTTYPE="text"NAME="bak_file"value="c:$1.bak">(备份或恢复的文件路径)<br><inputtype="submit"value="断定"></form><%SQLServer数据库的备份与恢复!海娃http://www.51windows.Netdimsqlserver,sqlname,sqlpassword,sqlLoginTimeout,databasename,bak_file,actsqlserver="localhost"sql服务器sqlname="sa"用户名sqlpassword="sa"暗码sqlLoginTimeout=15上岸超时databasename=trim(request("databasename"))bak_file=trim(request("bak_file"))bak_file=replace(bak_file,"$1",databasename)act=lcase(request("act"))ifdatabasename=""thenresponse.write"inputdatabasename"elseifact="backup"thenSetsrv=Server.CreateObject("SQLDMO.SQLServer")srv.LoginTimeout=sqlLoginTimeoutsrv.Connectsqlserver,sqlname,sqlpasswordSetbak=Server.CreateObject("SQLDMO.Backup")bak.Database=databasenamebak.Devices=Filesbak.Files=bak_filebak.SQLBackupsrviferr.number>0thenresponse.writeerr.number&"<fontcolor=red><br>"response.writeerr.description&"</font>"endifResponse.write"<fontcolor=green>备份乐成!</font>"elseifact="restore"then恢复时要在没有利用数据库时举行!Setsrv=Server.CreateObject("SQLDMO.SQLServer")srv.LoginTimeout=sqlLoginTimeoutsrv.Connectsqlserver,sqlname,sqlpasswordSetrest=Server.CreateObject("SQLDMO.Restore")rest.Action=0fulldbrestorerest.Database=databasenamerest.Devices=Filesrest.Files=bak_filerest.ReplaceDatabase=TrueForcerestoreoverexistingdatabaseiferr.number>0thenresponse.writeerr.number&"<fontcolor=red><br>"response.writeerr.description&"</font>"endifrest.SQLRestoresrvResponse.write"<fontcolor=green>恢复乐成!</font>"elseResponse.write"<fontcolor=red>没有选择操纵</font>"endifendif%></BODY></HTML>
</p>ASP脚本是采用明文(plaintext)方式来编写的。 |
|