%
CheckAdmin("AspCms_Data.asp")
if dbType=1 then die "SQL數據庫不能使用此功能,此功能只支持Access數據庫!"
dim action : action=getForm("action","get")
Select case action
case "del" : delBackUp
case "bakup" : backUp
case "delall" : delAll
case "restore" : restore
case "compress" : compress
End Select
Sub databackList
'die "aa"
dim path,fileListArray,i,arrayLen,fileAttr
path = sitePath&"/data/backup"
if not isExistFolder(path) then createFolder path,"folderdir"
fileListArray= getFileList(path)
arrayLen = ubound(fileListArray)
if instr(fileListArray(0),",")>0 then
for i = 0 to arrayLen
fileAttr=split(fileListArray(i),",")
echo "
"
end if
End Sub
Sub delBackUp
dim path
path = getForm("path","get")
delFile path
alertMsgAndGo "","AspCms_Data.asp"
End Sub
Sub backUp
dim fileName : fileName = timeToStr(now())
moveFile sitePath&"/"&accessFilePath,"../../../data/backup/"&fileName&"_bak.asp",""
alertMsgAndGo "備份成功","AspCms_Data.asp"
End Sub
Sub restore
dim path
path = getForm("path","get")
moveFile path,"/"&sitePath&accessFilePath,""
alertMsgAndGo "恢復成功","AspCms_Data.asp"
End Sub
Sub compress
dim engineObj,tempDbPath
tempDbPath = sitePath&"/"&"data/tempdata.asp"
conn.Class_Terminate
set engineObj = server.CreateObject("JRO.JetEngine")
engineObj.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath(sitePath&"/"&accessFilePath),"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& server.MapPath(tempDbPath)
moveFile tempDbPath,sitePath&"/"&accessFilePath,"del"
set engineObj = Nothing
alertMsgAndGo "壓縮成功","AspCms_Data.asp"
End Sub
Sub delAll
dim ids,idsArray,arrayLen,i
ids=replace(getForm("id","post")," ","")
idsArray = split(ids,",") : arrayLen=ubound(idsArray)
for i=0 to arrayLen
delFile idsArray(i)
next
alertMsgAndGo "刪除成功","AspCms_Data.asp"
End Sub
%>