%
'#################################################################################
'## Copyright (C) 2000-01 Michael Anderson and Pierre Gorissen
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
%>
<% If Session(strCookieURL & "Approval") = "15916941253" Then %>
<%
strTempFile = Server.MapPath("tools/Snitz_compacted.mdb")
strForumDB = getForumDB()
strForumDB = replace(strForumDB,";","",1,1)
%>
|
<% =fLang(strLangAdmin_Compactdb00040) %>
|
|
<% If request("action") <> "Yes" then %>
<% =fLang(strLangAdmin_Compactdb00050) %>
<% =fLangN(strLangAdmin_Compactdb00060, left(strForumDB,len(strForumDB)-5) & DateToStr(strForumTimeadjust) & ".bak" & "|" & strTempFile) %>
<% =fLang(strLangAdmin_Compactdb00070) %>
<% =fLang(strLangAdmin_Compactdb00080) %>
<% =fLang(strLangAdmin_Compactdb00090) %>
<% =fLangN(strLangAdmin_Compactdb00100, " ") %>
<% If Application("down") then %>
<%
End If
else
my_conn.close
strTempConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("tools/Snitz_compacted.mdb")
if BackupDB(strForumDB) then
set jro = server.createobject("jro.JetEngine")
jro.CompactDatabase strConnString, strTempConnString
if err <> 0 then
bError = True
response.write fLang(strLangAdmin_Compactdb00140) & " " & err.description
else
response.write "
" & fLang(strLangAdmin_Compactdb00150) & " "
end if
if not bError then
if not RenameFile( strTempFile, strForumDB) then
response.write fLang(strLangAdmin_Compactdb00160) & " " & err.description
else
response.write "
" & fLang(strLangAdmin_Compactdb00170) & " "
end if
end if
else
response.write "
" & fLang(strLangAdmin_Compactdb00180) & " "
end if
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
End If
End if
%>
|
|
<% If Application("down") then %>
<% End If %>
<%
WriteFooter
Function RenameFile(sFrom, sTo)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
if err.number <> 0 then
RenameFile = False
Exit Function
end if
fso.DeleteFile sTo,true
fso.MoveFile sFrom, sTo
set fso = nothing
RenameFile = True
End Function
Function BackupDB(sFrom)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
if err.number <> 0 then
BackupDB = False
Exit Function
end if
fso.CopyFile sFrom, fso.GetParentFolderName(sFrom) & "\" & fso.GetBaseName(sFrom) & DateTostr(strForumTimeAdjust) & ".bak", true
set fso = nothing
BackupDB = True
End Function
function GetForumDB()
dim tmpFileName
tmpFileName = split(strConnstring,"Source=",2,1)
GetForumDB = tmpFileName(1)
End function
%>