i have a splash screen that my users need to hit ok on to get into the database... the first thing that button does is open my hidden form... this hidden form does nothing, takes up extreemly little memory, and doesn't slow the app down at all (untill it's time to close it...)
then this form goes to work... it checks first to see if i'm on the computer that is hosting the database... that is the computer i use most while development... so i don't want to waste time waiting for it to talk to itself through the network
then it breaks down the date and puts it into a variable in this format
05172002
then it makes that directory in a sub directory called backup from the db directory... it also over writes each time so when another user exits later in the day, i have a newer backup... i only have 5 users including myself, so i'm not worried if two people try to exit at the same time... the reason i wanted to do this is because i wanted to have a backup at the end of the day after every one is out of the database... this way i don't have to be there to do it...
hope this code helps, it's almost exacly what i have... i've just changed comp names and directorys to post here... but it's valid code, just change any computer names and directorys...
--Junior
on the form, i have this code...
Private Sub Form_Close()
Dim strRootPath
Dim strFileName
Dim objScript
Dim strdate
Dim strMonth
Dim strDay
Dim strYear
Dim strSource
Dim strTarget
Set objScript = CreateObject("Scripting.FileSystemObject"
strMonth = DatePart("m", Date)
If Len(strMonth) = 1 Then strMonth = "0" & strMonth
strDay = DatePart("d", Date)
If Len(strDay) = 1 Then strDay = "0" & strDay
strYear = Right(DatePart("yyyy", Date), 4)
strdate = strMonth & strDay & strYear
If Not objScript.FolderExists("C:\dbhostdir"

Then
strRootPath = "\\hostingcompname\dbhostdir\"
strSource = strRootPath & "*.*"
strTarget = strRootPath & "backup\" & strdate & "\"
Else
strRootPath = "c:\dbhostdir\"
strSource = strRootPath & "*.*"
strTarget = strRootPath & "backup\" & strdate & "\"
End If
If Not objScript.FolderExists(strTarget) Then
objScript.CreateFolder (strRootPath & "backup\" & strdate & "\"

End If
objScript.CopyFile strSource, strTarget
Kill strTarget & "*.ldb"
Set objScript = Nothing
End Sub
JHauge@jmjpc.net
Life is change. To deny change is to deny life.