Operator problems with MyDAC for Delphi
Posted: Wed 07 May 2008 03:45
I do not have a lot of background with database SQL.
I am using a purchased copy of this software, Win XP, MySQL database
When I select a table, then a cellID eg. ProjectID=1 , then bselect a Member = B1, then add data to a table and save it all is well.
If I then select the following Same ProjectID New Member below.
MySQLQuery4.Close;
MySQLQuery4.SQL.Clear;
MySQLQuery4.SQL.Add('SELECT * FROM projectboq where ProjectID = ' + edtQuoteNo.Text + ' AND ' +
'EngMark =''' + edtEngMark.Text + ''';');
MySQLQuery4.ExecSQL;
MySQLQuery4.Active := True;
The new record in the table is selected! All appears OK. ProjectID=1, Member = B2
Here is my problem....
ProjectID=1 and member = B2, then add data to a table and saved, the data is saved in the first record, that is Member=B1
MySQLTable4.Edit;
MySQLTable4.FieldByName('ProjectID').AsInteger := StrToInt(edtQuoteNo.Text);
MySQLTable4.FieldByName('Zone').AsString := edtSelectZone.Text;
MySQLTable4.FieldByName('EngMark').AsString := edtEngMark.Text;
MySQLTable4.Post;
This is driving me mad and it must be my stupid error. Help please.
I am using a purchased copy of this software, Win XP, MySQL database
When I select a table, then a cellID eg. ProjectID=1 , then bselect a Member = B1, then add data to a table and save it all is well.
If I then select the following Same ProjectID New Member below.
MySQLQuery4.Close;
MySQLQuery4.SQL.Clear;
MySQLQuery4.SQL.Add('SELECT * FROM projectboq where ProjectID = ' + edtQuoteNo.Text + ' AND ' +
'EngMark =''' + edtEngMark.Text + ''';');
MySQLQuery4.ExecSQL;
MySQLQuery4.Active := True;
The new record in the table is selected! All appears OK. ProjectID=1, Member = B2
Here is my problem....
ProjectID=1 and member = B2, then add data to a table and saved, the data is saved in the first record, that is Member=B1
MySQLTable4.Edit;
MySQLTable4.FieldByName('ProjectID').AsInteger := StrToInt(edtQuoteNo.Text);
MySQLTable4.FieldByName('Zone').AsString := edtSelectZone.Text;
MySQLTable4.FieldByName('EngMark').AsString := edtEngMark.Text;
MySQLTable4.Post;
This is driving me mad and it must be my stupid error. Help please.