Results 1 to 3 of 3

Thread: Has anyone gotten a "bad file name or number" error opening a large file over network

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    25

    Has anyone gotten a "bad file name or number" error opening a large file over network

    File is about 150mb and file open code is as follows:

    Code:
    Dim Filenr As Integer
    Dim ByteArray() As Byte
    
    Filenr = FreeFile
    Open Filename For Binary As #Filenr
    ReDim ByteArray(0 To LOF(Filenr) - 1)
    Get #Filenr, , ByteArray()
    Close #Filenr
    I get the "bad file name or number" error on the Get #Filenr, , ByteArray() line.

    It only seems to happen with large files and works fine for other smaller files.

    Any ideas?

  2. #2
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    Try declaring Filenr as Long.
    "If at first you don't succeed, then skydiving is not for you"

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    25
    Tried as long and didn't have an effect.

    I Wouldn't really think this would matter. I am opening one file at a time so this nuber (so far) has always been 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