Overflow Error OPENing ISAM File with TYPE > 255 Elements (62773)






This article was previously published under Q62773

SUMMARY

An "Overflow" error will occur when you OPEN a file FOR ISAM with a TYPE containing 255 or more elements. This is a limitation of the ISAM engine of Microsoft Basic Professional Development System (PDS) version 7.1 for MS-DOS and MS OS/2 and Basic PDS version 7.0 for MS-DOS.

To work around this limitation, reduce the number of elements in the main type by combining some elements into a nested type or into arrays.

For information on a related record size limitation that may cause an "Overflow" error with fewer than 255 elements, query on the following words in the Microsoft Knowledge Base:

insert AND table AND isam AND overflow

MORE INFORMATION

Code Example

The following program fragment demonstrates the problem. (The majority of the TYPE statement is left out for space reasons, and needs to be expanded from I4 to I250 as shown in a comment below). The "Overflow" error will occur on the OPEN statement at run time:
TYPE BigType
  I1 AS INTEGER
  I2 AS INTEGER
  I3 AS INTEGER
        '...  <need to insert I4 to I250 here>  ...
  I251 AS INTEGER
  I252 AS INTEGER
  I253 AS INTEGER
  I254 AS INTEGER
  I255 AS INTEGER
END TYPE
OPEN "BigType" FOR ISAM BigType "BigType" AS #1  'Overflow error here
CLOSE
				
To work around the problem, you can make TYPE BigType out of nested types, such as the following:
TYPE NestType
  A AS INTEGER
  B AS INTEGER
  C AS INTEGER
  D AS INTEGER
  E AS INTEGER
END TYPE

TYPE NewBigType
  I1 AS INTEGER
  I2 AS INTEGER
  I3 AS INTEGER
    '...  <need to insert I4 to I250 here>  ...
  I248 AS INTEGER
  I249 AS INTEGER
  I250 AS INTEGER
  N AS NestType
END TYPE
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB62773