Compacting databases through ASP

Results 1 to 2 of 2

Thread: Compacting databases through ASP

  1. #1
    Peter H Guest

    Default Compacting databases through ASP

    The title says it all. Is it Possible, if so how?<BR><BR>Thanks

  2. #2
    malc@couriertracker.com Guest

    Default RE: Compacting databases through ASP

    Yeap - I got this from 15seconds.com (had to change a couple of lines)<BR>&#060;html&#062;<BR>&#060;!-- #INCLUDE FILE="adovbs.inc" --&#062;<BR><BR>&#060;head&#062;<BR>&#060;/head&#062;<BR><BR>&#060;body bgcolor="#FFFFFF"&#062;<BR><BR>&#060;hr&#062;<BR>& #060;%<BR>Response.write "Compacting database" & "<BR>"<BR><BR> database = "mydb"<BR> <BR> dim DaoDB,Fs<BR> set fs=server.createobject("scripting.filesystemobject ")<BR> <BR> if fs.fileexists(server.mappath("cgi-bin\" & database & "_optimized.mdb")) then<BR> fs.deletefile server.mappath("cgi-bin\" & database & "_optimized.mdb")<BR> end if<BR> <BR> set daodb=server.createobject("dao.dbengine.35")<BR> daodb.compactdatabase server.mappath("cgi-bin\" & database & _<BR> ".mdb"),server.mappath("cgi-bin\" & database & "_optimized.mdb")<BR> <BR> &#039Replace old db with new db<BR> fs.copyfile server.mappath("cgi-bin\" & database & _<BR> "_optimized.mdb"),server.mappath("cgi-bin\" & database & ".mdb"),true<BR> <BR> &#039fs.deletefile server.mappath("cgi-bin\" & database & "_optimized.mdb")<BR> response.write "&#039Database UPDATED!!!" & "<BR>"<BR> <BR><BR> <BR>%&#062;<BR><BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •