Edit dosen't work
Posted: Wed 05 Apr 2006 14:48
Hello,
Since we install the DBEXpress MySQL, the edit fonction of the ClientDataset don't work.. We can Append a new record to the database but not edit.
I try a lot of combination, including changing field type and nothing seems working. The ReconcileError tell me that the record cannot be found or it might be take by someone else. (but it's not).
here is a little exemple of my code..
procedure TAppareils.DesactiverDB(var LeDataset: TClientDataset);
begin
if not LeDataset.Active then
LeDataset.Active := true;
if LeDataset.Locate('chr_Identificateur', FIdentificateur, Options) then;
begin
LeDataset.Edit;
LeDataset.FieldValues['chr_Actif'] := 'FALSE'; //false
// LeDataset.FieldByName('chr_Actif').AsString := 'FALSE';
// LeDataset.FieldByName('chr_Actif').Value := 'FALSE';
// LeDataset.post;
LeDataset.ApplyUpdates(-1);
end;
end;
My Connection is in 'MySQL Direct (Core Lab)' mode. MySQL version is mysql-4.1.18-win32.
As you can see the code is very simple.. it should work. Did the client dataset is the problem or another dbexpress component? I need help, i'm stuck here!
Thank you very much!
Luc
Since we install the DBEXpress MySQL, the edit fonction of the ClientDataset don't work.. We can Append a new record to the database but not edit.
I try a lot of combination, including changing field type and nothing seems working. The ReconcileError tell me that the record cannot be found or it might be take by someone else. (but it's not).
here is a little exemple of my code..
procedure TAppareils.DesactiverDB(var LeDataset: TClientDataset);
begin
if not LeDataset.Active then
LeDataset.Active := true;
if LeDataset.Locate('chr_Identificateur', FIdentificateur, Options) then;
begin
LeDataset.Edit;
LeDataset.FieldValues['chr_Actif'] := 'FALSE'; //false
// LeDataset.FieldByName('chr_Actif').AsString := 'FALSE';
// LeDataset.FieldByName('chr_Actif').Value := 'FALSE';
// LeDataset.post;
LeDataset.ApplyUpdates(-1);
end;
end;
My Connection is in 'MySQL Direct (Core Lab)' mode. MySQL version is mysql-4.1.18-win32.
As you can see the code is very simple.. it should work. Did the client dataset is the problem or another dbexpress component? I need help, i'm stuck here!
Thank you very much!
Luc