Informix Error -2841: The form must include a tables declaration before the attributes section.
Cause and resolution
The form must include a tables declaration before the attributes section.
Check that the form-specification file contains a DATABASE statement, a SCREEN section, a TABLES section, and an ATTRIBUTES section, in that order.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2841 fires when a form specification's TABLES section is missing or appears after
ATTRIBUTES — per the official guidance, the form's sections must appear in a specific order:
DATABASE, SCREEN, TABLES, then ATTRIBUTES.
- The
TABLESsection missing entirely, per the official guidance — the direct, common cause. - The
TABLESsection present but placed afterATTRIBUTES, per the official guidance's other named case — violating the required order.
Solutions / Resolution
- Add (or reorder) the
TABLESsection so the form's sections appear in the required order:DATABASE,SCREEN,TABLES,ATTRIBUTES, per the official guidance.
Examples
Sections in the wrong order
DATABASE stores7
SCREEN { ... }
ATTRIBUTES
order_id = orders.order_id;
TABLES
orders
-- -2841: TABLES appears after ATTRIBUTES
Corrected
DATABASE stores7
SCREEN { ... }
TABLES
orders
ATTRIBUTES
order_id = orders.order_id;
Diagnostic Checks
- Check the form specification's section order against the required sequence:
DATABASE,SCREEN,TABLES,ATTRIBUTES.
Related Errors / Related Topics
- -2800 — "The first line of the specification must be the keyword database followed by the database name..." A related structural error, about the very first line specifically.
The TABLES section is missing or out of order — it must come before ATTRIBUTES, after
DATABASE/SCREEN.