Results 1 to 3 of 3

Thread: Sequential Access Files

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    80

    Talking Sequential Access Files

    Does anyone know how to check to see if a file is already open.

    I have a file in a loop but when it executes the loop the second time it says FILE ALREAY OPEN.
    I had originally fixed this with a boolean but I don't want to do that.

    I need something like

    IF File#1.AlreadyOpen Then
    ''''''
    END IF

    Can someone help?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    You can use FreeFile function that will open this file in another available channel.
    VB Code:
    1. Dim intFFN As Integer
    2.  
    3. intFFN = FreeFile
    4.  
    5. Open "C:\YourFile.txt" For Input As intFFN
    6. 'do you stuff here
    7. Close #intFFN

  3. #3
    trophyfish
    Guest
    Try closing it before opening it a 2nd time

    close #1

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