Field not found
Posted: Mon 09 Jan 2006 17:12
I'm pulling my hair out:
Maintaining an existing/legacy app that uses the TMyQuery components. I'm getting a "Field not found" error with the following code:
q_LifeSafety.Insert;
q_LifeSafety.FieldByName('WORKORDER_ID').AsInteger := AWorkOrderID; //<--Field 'WORKORDER_ID' not found
...
q_LifeSafety.Post;
although there is existing code for another TMyQuery component and table that follows this same pattern and works just fine.
q_LifeSafety is a TMyQuery component that has the following Insert statement:
INSERT INTO pm_data.workorders_islms
(ID, WORKORDER_ID, ILSM_MATRIX_CELL, CREATED, CREATED_BY)
VALUES
(:ID, :WORKORDER_ID, :ILSM_MATRIX_CELL, :CREATED, :CREATED_BY)
The error occurs with or without the ID values being there (ID is an autoinc field).
Maintaining an existing/legacy app that uses the TMyQuery components. I'm getting a "Field not found" error with the following code:
q_LifeSafety.Insert;
q_LifeSafety.FieldByName('WORKORDER_ID').AsInteger := AWorkOrderID; //<--Field 'WORKORDER_ID' not found
...
q_LifeSafety.Post;
although there is existing code for another TMyQuery component and table that follows this same pattern and works just fine.
q_LifeSafety is a TMyQuery component that has the following Insert statement:
INSERT INTO pm_data.workorders_islms
(ID, WORKORDER_ID, ILSM_MATRIX_CELL, CREATED, CREATED_BY)
VALUES
(:ID, :WORKORDER_ID, :ILSM_MATRIX_CELL, :CREATED, :CREATED_BY)
The error occurs with or without the ID values being there (ID is an autoinc field).