|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp,jsp,php是web开发的三大技术,asp简单易用且有microsoft做靠山,jsp功能强大是因为有java支持,php则开源跨平台.在国内,asp应用范围最广,jsp发展势头最猛,php则处于劣势.这可能与公司的支持以及技术的培训有关.备份|数据|数据库文件1:BackupDB.asp
<%@Language=VBScript%>
<HTML>
<HEAD>
<METAname=VI60_defaultClientScriptcontent=VBScript>
<METANAME="GENERATOR"Content="MicrosoftFrontPage4.0">
<SCRIPTID=clientEventHandlersVBSLANGUAGE=vbscript>
<!--
Subbtnbak_onclick
iffrmbak.txtsvr.value=""then
window.alert("ServerNameisempty!")
frmbak.txtsvr.focus
exitsub
endif
iffrmbak.txtuid.value=""then
window.alert("Administratorsisempty!")
frmbak.txtuid.focus
exitsub
endif
iffrmbak.txtdb.value=""then
window.alert("Databaseisempty!")
frmbak.txtdb.focus
exitsub
endif
iffrmbak.txtto.value=""then
window.alert("BackupToisempty!")
frmbak.txtto.focus
exitsub
endif
frmbak.submit
EndSub
-->
</SCRIPT>
<linkrel="stylesheet"href="../../sheets/B2BStyle.CSS">
</HEAD>
<formaction="backupdbsave.asp"method="post"id=frmbakname=frmbak>
<bodyclass="bg_frame_up">
<pclass=heading>Database-->Backup</p>
<Palign=center>
<divalign="center">
<center>
<tablewidth="60%"cellpadding=1cellspacing=1border=0align=center>
<tr>
<tdclass=TD_Mand_FNalign="center"height="35"width="40%">ServerName:</td>
<tdclass=TD_Mand_Fheight="35"width="59%">
<INPUTid=txtsvrname=txtsvrsize="20"style="font-family:Arial;font-size:9pt"></td>
</tr>
<tr>
<tdclass=TD_Mand_FNalign="center"height="35"width="40%">Administrators:</td>
<tdclass=TD_Mand_Fheight="35"width="59%">
<INPUTid=txtuidname=txtuidsize="20"style="font-family:Arial;font-size:9pt"></td>
</tr>
<tr>
<tdclass=TD_Mand_FNalign="center"height="35"width="40%">Password:</td>
<tdclass=TD_Mand_Fheight="35"width="59%">
<INPUTid=txtpwdname=txtpwdtype=passwordstyle="font-family:Arial;font-size:9pt"></td>
</tr>
<tr>
<tdclass=TD_Mand_FNalign="center"height="35"width="40%">Database:</td>
<tdclass=TD_Mand_Fheight="35"width="59%">
<palign="left">
<INPUTid=txtdbname=txtdbsize="20"style="font-family:Arial;font-size:9pt"></p>
</td>
</tr>
<tdclass=TD_Mand_FNalign="center"height="35"width="40%">BackupTo:<br>
<u>(ServerPath)</u></td>
<tdclass=TD_Mand_Fheight="35"width="59%">
<inputid=txttoname=txttostyle="font-family:Arial;font-size:9pt"></td>
</tr>
</table>
</center></div>
<palign=center><inputid=btnbakname=btnbaktype=buttonvalue="StartBackup"style="font-family:Arial;font-size:9pt"></p>
</body>
</form>
</HTML>
文件2:BackupDBSave.asp
<%@Language=VBScript%>
<%
dimmsvr,muid,mpwd,mdb,mto
msvr=Request.Form("txtsvr")
muid=Request.Form("txtuid")
mpwd=Request.Form("txtpwd")
mdb=Request.Form("txtdb")
mto=Request.Form("txtto")
ifmpwd=""thenmpwd=""
onerrorresumenext
setdmosvr=server.CreateObject("SQLDMO.SQLServer")
dmosvr.connectmsvr,muid,mpwd
iferr.number>0thenResponse.Redirect("http:backuperr.asp?err="&err.number)
mdevname="Backup_"&muid&"_"&mdb
setdmodev=server.CreateObject("SQLDMO.BackupDevice")
dmodev.name=mdevname
dmodev.type=2
dmodev.PhysicalLocation=mto
dmosvr.BackupDevices.Adddmodev
iferr.number>0thenResponse.Redirect("http:backuperr.asp?err="&err.number)
setdmobak=server.CreateObject("SQLDMO.Backup")
dmobak.database=mdb</p>因为现在数据库都使用标准的SQL语言对数据库进行管理,所以如果是标准SQL语言,两者基本上都可以通用的。SQLServer还有更多的扩展,可以用存储过程,数据库大小无极限限制。 |
|