Over a million developers have joined DZone.

Using Command ADO In Delphi

·
Usage example of TADOCommand in Delphi


function TfrmCreateEdit.UpdateBooking(dbName: TADOCommand ; tblName : string ; RecID : integer) : boolean;
begin
  Result := False;

  with dbName do begin
      CommandText := 'UPDATE ' + tblName
      + ' SET '
      + ' Title = ''' + strTitle + ''''
      + ' ,FirstName = ''' + strFirstName + ''''
      + ' ,LastName = ''' + strLastName + ''''
      + ' ,JobTitle =  ''' + strJobTitle + ''''
      + ' ,Department =  ''' + strDepartment + ''''
      + ' WHERE RecID = ' + IntToStr(RecID);

      try
         memoDebug.Text := CommandText;
         Execute;
         Result := True;
      except
         Result := False;
      end;

  end;
end;
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}