Check for File Existence in VB6.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmurphmsu
    New Member
    • Nov 2006
    • 19

    Check for File Existence in VB6.

    Can someone please tell me how to check to see if a file exists in VB 6.
  • albertw
    Contributor
    • Oct 2006
    • 267

    #2
    Originally posted by mmurphmsu
    Can someone please tell me how to check to see if a file exists in VB 6.
    hi

    try using

    ret=dir (path & filename , 0)
    ret will be empty is the file doesn't exist

    Comment

    • mmurphmsu
      New Member
      • Nov 2006
      • 19

      #3
      Originally posted by albertw
      hi

      try using

      ret=dir (path & filename , 0)
      ret will be empty is the file doesn't exist

      What data type should ret be?

      Comment

      • albertw
        Contributor
        • Oct 2006
        • 267

        #4
        Originally posted by mmurphmsu
        What data type should ret be?
        hi

        ret is a stringtype

        Comment

        • jpezhil
          New Member
          • Sep 2006
          • 9

          #5
          1.Ist Invoke Microsoft Scripting Runtime Reference in Our Project(in Code)
          2.In Declaration Part
          ex : dim fs as new FileSystem
          3.
          ' ex: FilePath and name app.path & "Filename"

          if fs.fileexists(a pp.path & "1.jas") then
          msgbox("File Found")
          else
          msgbox("File Not Found")
          endif
          Thanking U
          - R.Jayaprakash

          Comment

          Working...