Bad record length

Among the possible causes of this error are:

  • The length of a record variable specified in a FileGet, FileGetObject, FilePut or FilePutObject statement differs from the length specified in the corresponding FileOpen statement.

  • The variable in a FilePut or FilePutObject statement is or includes a variable-length string.

  • The variable in a FilePut or FilePutObject is or includes a Varianttype**.**

To correct this error

  1. Make sure the sum of the sizes of fixed-length variables in the user-defined type defining the record variable's type is the same as the value stated in the FileOpen statement's Len clause.

  2. If the variable in a FilePut or FilePutObject statement is or includes a variable-length string, make sure the variable-length string is at least 2 characters shorter than the record length specified in the Len clause of the FileOpen statement.

  3. If the variable in a FilePut or FilePutObject is or includes a Variant make sure the variable-length string is at least 4 bytes shorter than the record length specified in the Len clause of the FileOpen statement.

See Also

Reference

FileGet Function

FileGetObject Function

FilePut Function

FilePutObject Function