I am having a problem inserting a record using TADOQuery in Delphi 5. The query is open and active (the associated datasource state is in dsBrowse) when I try to perform the insert:
with DM.CustPartQuery do begin
Insert;
FieldByName('PKEY').AsStri
ng := IntToStr(nNextPKey);
FieldByName('MCI_NBR').AsS
tring := IntToStr(nNextMCINbr);
FieldByName('FILM_STATUS')
.AsString := 'Active';
FieldByName('SUBCONTRACTED
').AsBoole
an := (Response=mrYes);
end;
During debug I can see that after the insert statement, the datasource is still in dsBrowse mode. Then when it tries to assign the first field, I get an error "Dataset not in insert or edit mode"
What am I doing wrong?
Start Free Trial