Einzelnen Beitrag anzeigen

danten

Registriert seit: 19. Feb 2012
Ort: Czech Republic, Prag
126 Beiträge
 
Delphi 10.1 Berlin Architect
 
#1

Find all the records in the table and change the text

  Alt 25. Jan 2013, 11:10
Datenbank: Absolute Database • Version: 4 • Zugriff über: Absolute Database
Hi everyone.
Please help with the code.
I need to retrieve all records entered in Edit1 and rewrite them according Edit2.

I use this code, but it overwrites all raises my records in the table.

Edit1.Text = Old string
Edit2.Text = New string


Delphi-Quellcode:
var
  Options: TLocateOptions;
begin
  Options := Options + [loPartialKey, loCaseInsensitive];
  Table1.Close;
  Table1.Open;
  Table1.Locate('Permission',Edit1.Text,Options);
  Table1.First;
  while not Table1.eof do
  begin
    loginForm.ABSTable1.Edit;
    loginForm.ABSTable1.FieldByName('Permission').AsString := Edit2.Text;
    loginForm.ABSTable1.Post;
    loginForm.ABSTable1.next;
    loginForm.ABSTable1.Locate('Permission',Edit1.Text,Options);
  end;

  ShowMessage('Permissions have been changed..');
Thank you all.
Miniaturansicht angehängter Grafiken
rename.png  
Daniel
  Mit Zitat antworten Zitat