Results 1 to 3 of 3

Thread: random mode file giving problems in 98

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    Iowa
    Posts
    2

    Question

    I am writing a program that makes use of a random mode file to store equipment numbers. When executed on an NT or 2000 machine it works great. When executed on a 98 machine it works fine when the file is first initialized, but everytime after that give an error "bad record length".

    The file has about 600 records and stops on record 50 when the error is given.

    This is how I open the file:
    Open "c:\temp\data.ran" For Random As #1

    This is how I close it:
    Close #1

    The program has to be demonstrated on a 98 machine, so I would like to find a fix. Can anyone help?

  2. #2
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    You need to declare the length of the records
    eg. Open "c:\temp\data.ran" For Random As #1 Len = 20


  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    Iowa
    Posts
    2
    Tried that. If not specified, VB assumes 256. Thanks though.

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