<% '################################################################################# '## 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 %>
 All Forums
 Forum Deletion/Archival
 Compact Database

<% strTempFile = Server.MapPath("tools/Snitz_compacted.mdb") strForumDB = getForumDB() strForumDB = replace(strForumDB,";","",1,1) %>
Administrative Forum Archive Functions - Compact DB
<% If request("action") <> "Yes" then %>
Depending on security settings at your Host, these operations may or may not be succesful, However no harm should befall your data

Your original database will be copied to <%= left(strForumDB,len(strForumDB)-5) & DateToStr(strForumTimeadjust) & ".bak" %> as a backup and then compacted to <%= strTempFile %>

If these steps are successful, the original DB will be replaced by the compacted DB.

This may take some time depending on the size of your database.

You will have to CLOSE the forum while the compacting is running.
Click here to close the forum before you start

<% If Application("down") then %>
Are you sure you want to compact the database?
Yes No
<% 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 "Error Compacting:
" & err.description else response.write "
Database Compacted successfuly.
" end if if not bError then if not RenameFile( strTempFile, strForumDB) then response.write "Error Replacing:
" & err.description else response.write "
Databases renamed successfuly.

" end if end if else response.write "
Unable to back up database

" end if set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString End If End if %>

<% If Application("down") then %>
Open Forum
<% 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 %>