Results 1 to 2 of 2

Thread: scripting vs as input

  1. #1
    contendo
    Guest

    scripting vs as input

    i'm pretty new to vb and am having a bit of trouble reading files.
    i am currently using the newer version "Scripting.FileSystemObject"
    but am receiving an error when i attempt to open a text file for reading.
    here's the code currently:

    Set fso = CreateObject("Scripting.FileSystemObject")
    If (fso.FileExists(sSQLPath)) Then
    Set tso = fso.OpenTextFile(sPath, ForReading, False, TriStateFalse)

    and here's my error information:

    Error Number: 5
    Error Description: Invalid procedure call or argument

    the path is valid, so i get into the if block fine, i receive an error at the open line.
    when i use the older method, it works fine. since there's more flexibility in the FileSystemObject, i'd prefer to use this. is there something obviously wrong here?


    justin

  2. #2
    Fanatic Member dongaman's Avatar
    Join Date
    Aug 2001
    Location
    xi'an
    Posts
    616
    Your code run on my computer is ok.May be u should check sSQLPath
    I am just aman.

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