Re: Execute code before closing script by Davor
Davor
Mon Aug 22 10:41:32 CDT 2005
Tim,
yes, you'r right, that is a possibility.
In the end, seems there is no way to exit the endles loop when shuting down
the system/script.
Greets
Davor
"Tim" wrote:
> Davor,
>
> Is your script automatically started when the server boots?
>
> If so, (assuming I understand you correctly) it will be a lot easier to
> to have your script compact and repair your DB as the first thing it
> does *before* it goes into the infinite loop.
>
> One way to compact your mdb is :
>
> Dim JE,ActuallDB,TempDB,FSO,Prov
>
> Set FSO = CreateObject("Scripting.FileSystemObject")
>
> ActuallDB = "c:\mydb.mdb" 'this is your actual mdb
>
> TempDB = "c:\mydb_temp.mdb"
>
>
> Set JE=CreateObject("JRO.JetEngine")
>
> Prov="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
> JE.CompactDatabase Prov & ActuallDB & ";",Prov & TempDB & ";"
>
> FSO.CopyFile TempDB,ActuallDB,true
> FSO.DeleteFile TempDB
>
> Regards,
>
> Tim
>
>