Using Zeos 6.6.1beta under Delphi 7, my database is a MySQL 5.x on a SuSE Linux server.
The problem is the following code crashes with a EDatabaseError : "ZEditQuery: dataset is not in edit or insert mode". This only happens about 50% of the time, the other 50% it seems to be fine.
Code: Select all
WITH TZQuery(OrdersDataModule.OrdersSource.DataSet) DO
BEGIN;
Close; { Close any pending query }
SQL.Text:=Format('SELECT * from %s where recno=''%s''',[Defs.ViewEditTable.TableName.Value,InRecordNo]);
Open; { Open query and go into edit mode }
Edit;
OrderStatus:=FieldByName('status').AsString;
PosterName:=FieldByName('netname').AsString;
CTName:=OrdersDataModule.GetCTNetName(FieldByName('chieftech').AsString);
END;
The code crashes when executing the Open statement. Before entering this code the query has been used to perform an insert using ExecSQL, which is why the close at the start of the above code.
Can anyone shead any light on this ?
Cheers.
Phill.