Results 1 to 5 of 5

Thread: Walk Around This? FSO

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Post

    I use th code below and it works fine on my pc because I have VB6 installed. When I make it into and exe and copy it and the msv60 file on another pc I get the error.."Active X cannot create object...of course this is the FSO object.
    I don't want to make a full install..
    How do I include the FSO or use another method to get the file last modified date?
    API?

    Thanks,
    Wayne
    '==========================================Sub Info(filespec)
    Dim fs, f, s, ct
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(filespec)

    s = f.datelastmodified
    If Format(s, "yyyy,mm,dd") <> Format(Date, "yyyy,mm,dd") Then
    sendmsg = "DoIt"
    List1.AddItem "Problem #" & (iFiles + 1) & ":"
    List1.AddItem filespec & ": has not been modified today!"
    List1.AddItem "The last time modification was " & s
    List1.AddItem ""
    List1.AddItem "________________________________________________"
    List1.AddItem ""
    Else
    List1.AddItem (iFiles + 1) & " " & "Processed OK"
    List1.AddItem ""
    List1.AddItem "________________________________________________"
    List1.AddItem ""
    End If


    End Sub

    Private Sub Form_Load()


    'count files in a directory


    Dim sDir As String
    sDir = Dir("j:\*.dat", vbNormal)
    While sDir <> ""

    MyCollection.Add sDir
    Call Info("j:\" & MyCollection(iFiles + 1))
    iFiles = iFiles + 1
    sDir = Dir
    Wend
    DoEvents

    Dim msg$
    If sendmsg = "DoIt" Then
    msg = "The IVR Move needs to be rerun." & vbCrLf
    MsgBox msg
    Else
    msg = "All's Well..No Problems!"
    End If

    End Sub


  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    You have to include scrrun.dll with your EXE as well.

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819


  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    If all you're after is the Creation/Last Modified Date/Time, use the VB Function FileDateTime()

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  4. #4

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Post

    Thank you both...one goes in the notes..the other gets applied for future reference.
    Wayne

  5. #5
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    or use

    Code:
        'This is the modified date
        varFileDateTime = FileDateTime(strDirPath & SYSFILE)

Posting Permissions

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



Click Here to Expand Forum to Full Width