"Invalid Column" If CREATEINDEX on Field of Nested User TYPE (65506)






This article was previously published under Q65506

SUMMARY

In Microsoft Basic ISAM, you cannot create an index on a user-defined TYPE, nor can you create an index on a field of a nested user-defined TYPE.

This information applies to Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 under MS-DOS and version 7.10 under OS/2.

MORE INFORMATION

Page 333 of the "Microsoft Basic 7.0: Programmer's Guide" and Page 72 of the "Microsoft Basic 7.0: Language Reference" manual for versions 7.00 and 7.10 correctly state that an index cannot be created on an aggregate data type such as a user-defined TYPE. However, they fail to state that you cannot create an index on a field of that nested user-defined TYPE.

For example, in the following TYPE...END TYPE declaration, you can create an index on the field "CustomerName" but not on the user-defined TYPE "CompanyInfo" or on the field of the nested user-defined TYPE "CompanyID". If you try to create an index on these fields, an "Invalid Column" error is generated on the CREATEINDEX statement.
   TYPE CompanyRec
             CompanyID AS INTEGER
   END TYPE

   TYPE CustomerRec
             CustomerName AS STRING * 20
             CompanyInfo AS CompanyRec
   END TYPE
				

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: KB65506