I'm using a DisableControls with a ZQuery or ZReadOnlyQuery, the cursor of DataSet stay freak.
Example: The Query returned 5 rows and in a loop command from the first to the last record, using DisableControls command. The cursor stay freak, it's pass for record nº 3 and jump to the End of File (EOF).
See the code:
Code: Select all
DmSoftware.Tab_Cli_X_Soft.First;
DmSoftware.Tab_Cli_X_Soft.DisableControls;
while not DmSoftware.Tab_Cli_X_Soft.EOF do
begin
DmSoftware.Tab_Sistemas.Locate('Nome_Software', DmSoftware.Tab_Cli_X_SoftSistemas.AsString, []);
if (DmSoftware.Tab_Cli_X_SoftSistemas.AsString = DmSoftware.Tab_SistemasNome_Software.AsString) then
begin
DmSoftware.Tab_Cli_X_Soft.Edit;
L.FiltraSql(DMSoftware.Q_Pesq, ' Top 1 Nome_Software, Versao', 'Cod_x_Software', 'Nome_Software='+#39+DMSoftware.Tab_Cli_x_SoftSistemas.AsString+#39+' Order by Data desc');
DmSoftware.Tab_Cli_X_SoftVersao_Extra.AsString := DMSoftware.Q_Pesq.FieldbyName('Versao').AsString;
DmSoftware.Tab_Cli_X_Soft.Post;
End;
DmSoftware.Tab_Cli_X_Soft.Next;
end; // while
DmSoftware.Tab_Cli_X_Soft.EnableControls;
DmSoftware.Tab_Cli_X_Soft.First;