Post error

Dave

Member
I have a strange error occuring. I put a dataset in the edit mode, change a field's value, then post. When the post command is issued, I get an error saying that the dataset is not in the edit or insert mode. Why is this? I explicitly set it to the edit mode. Very confusing.

TIA,
Dave
 
Are you using any events on this dataset that might affect its state? If so, try to find out if any of them may be causing this problem.

My guess is that somewhere between Edit and Post the state must have been changed from dsEdit to something else.

------------------
Marco Kalter
Allround Automations
 
Actually the code is this:

with salestable do begin
edit;
fieldbyname('price').value:=100;
post;
end;

When I step through the code, it errors out when it hits the post command. The error is telliung me that the dataset is not in the edit or insert mode. Strange.

Dave
 
Okay, but have you defined any events for this dataset? If not, what is the SQL text?

------------------
Marco Kalter
Allround Automations
 
No events, and the sql is this:

select s.*, s.rowid from salestable s where s.department=:dept

I feed the variable into the sql earlier in the code. I know that part works because the dataset is returned properly into a dbgrid.

Dave
 
Back
Top