|
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
%>
|
|