Backup | data | database | No component has seen the backup and restore of the database. Most of them are done with components. Can actually be done through SQL statements.
Because of the time relationship, parameters are not validated and the interface is beautified. The code is for informational purposes only.
Total 4 files: Download address: Http://ad.ceh.com.cn/sql.rar
Conn.asp
<%
Conn= "Provider=SQLOLEDB.1; Persist Security Info=false; server=127.0.0.1; Uid=sa;pwd=www.zhi.net;database=master "
Function Rec (rs,sql)
Set rs = server. CreateObject ("ADODB.") Recordset ")
Rs. ActiveConnection = conn
Rs. Source = sql
Rs. CursorType = 0
Rs. CursorLocation = 3
Rs. LockType = 1
Rs. Open
If rs.eof and Rs.bof then
rec= false
Else
rec= true
End If
End Function
function cmd (SQL)
Dim cmd1
Set cmd1 = Server. CreateObject ("Adodb.command")
Cmd1. ActiveConnection = conn
Cmd1.commandtext = sql
Cmd1.commandtype = 1
Cmd1.commandtimeout = 0
Cmd1. Prepared = True
Cmd1. Execute ()
End Function
Function cdb (RS)
Rs.close ()
Set rs=nothing
End Function
%>
Dev.asp
<!--#include file= "conn.asp"-->
<%
If Request ("Adddev") <> "then
Sql= Select Name,phyname from Master. sysdevices where status=16 and Name= ' "&request (" Devname ") &" ' "
Rec Chk,sql
If chk.eof and Chk.bof then
sql = "Sp_addumpdevice ' Disk", ' "&request (" Devname ") &" ', ' "&request (" Phyname ") &" ' "
CMD sql
Response. Write "<script language=javascript>window.location=reload;</script>"
Else
Response. Write "<script language=javascript>alert (" Devname "&request) & device already exists in the database! '); window.location= ' cmd.asp ';</script> '
End If
End If
If Request ("Deldev") <> "then
sql = "Sp_dropdevice '" &request ("Devname") & "'"
CMD sql
Response. Write "<script language=javascript>window.location=reload;</script>"
End If
Rec li, "select Name,phyname from Master." sysdevices where status=16 "
If li.eof and Li.bof then
Response. Write "<font color= #ff0000 > Please create a new backup device to back up the restore Database </font>"
Else
%><style type= "Text/css" >
<!--
Body {
margin-left:0px;
margin-top:0px;
}
-->
</style>
<table width= "60%" border= "0" cellspacing= "0" >
<tr>
<TD width= "29%" > Name:</td>
<TD width= "71%" > Location:</td>
</tr>
<%
I=0
While not li.eof
I=i+1
%>
<tr>
<td><%=li (0)%></td>
<td><%=li (1)%> <a href= ' dev.asp? Deldev=1&devname=<%=li (0)%> ' > Remove this device </a></td>
</tr>
<%
Li.movenext
Wend
Response. Write "<script language=javascript>top.document.all.dev.height= '" & (i+1) *25& "';</script>"
CDB Li
%>
</table>
<%
End If
%>
Default.asp
<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<!--#include file= "conn.asp"-->
<%
'*************************************************
' Database backup and restore
' Programming: Magician Yang (magicyang.cn)
' Completion date: 2004-4-11
' Description: Data does not have security validation due to time relationship.
' Verify the data when applying to ensure security.
' qq:1168064 welcome everyone to talk to each other
'*************************************************
%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Backup and restore of database </title>
<body>
<%
%>
<table width= "80%" border= "0" align= "center" >
<tr>
<TD width= "21%" valign= "top" > Database device:</td>
<TD width= "79%" >
<iframe name= "Dev" src= "dev.asp" width= "100%" height= "0" frameborder= "No." Scrolling= "no" ></iframe>
</td>
</tr>
<tr>
<td> Add Equipment:</td>
<td> Equipment Name:
<input name= "Devname" type= "text" id= "Devname" size= "ten" maxlength= "ten" ></td>
&