Results 1 to 6 of 6

Thread: how to Get Folder Name VB6!!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    7

    Exclamation how to Get Folder Name VB6!!!

    this is my problem, i need to look in a particular directory with folder names as dates in this format

    08132007
    08122007
    08112007....

    etc

    i need to check the directory these folders exist in and look for the folder that matches todays date... i'm new to VB6 and i am unlear on how to do this.

    can someone please help!!?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how to Get Folder Name VB6!!!

    Try this
    Code:
    Private Sub Command1_Click()
    Dim strLoad As String
    Dim strDate As String
    strDate = Format(Now, "mmddyyyy")
    List1.Clear
    strLoad = Dir("d:\*.*")
    Do While strLoad > vbNullString
       If strDate = strLoad Then 'we have a match
          'do something
       End If
       strLoad = Dir
    Loop
    End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    7

    Re: how to Get Folder Name VB6!!!

    when i try that code its returning file names, instead of folder names.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    7

    Exclamation Re: how to Get Folder Name VB6!!!

    i need to return folder names instead of filenames please help!

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how to Get Folder Name VB6!!!

    Code:
    'change
    strLoad = Dir("d:\*.*")
    'to
    strLoad = Dir("d:\*.*\", vbDirectory)

  6. #6
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    Re: how to Get Folder Name VB6!!!

    excuse the mistakes, its 3am here.

    EDIT: Hack got in before me <_< sorry
    Attached Files Attached Files

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