Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   GotoBookMark record not found (https://www.clubdelphi.com/foros/showthread.php?t=78909)

Jere_84 24-05-2012 16:41:10

GotoBookMark record not found
 
Este código funcionaba correctamente en versiones de delphi 6, pero al trasladarlo a Delphi 2010 sale el error "ClientDataSet record not found". Alguien sabe cual puede ser el problema.

Código Delphi [-]
    bmReg := GetBookmark;
    try
      sPredAnt := FieldByName( 'Prede' ).AsString;
      if (sPredAnt = 'P') or Locate('Prede', 'P', []) then
      begin
        Edit;
        FieldByName( 'ImagenPrede' ).Assign( TBitmap.Create );
        FieldByName( 'Prede' ).AsString := ' ';
        Post;
      end;
    finally
      GotoBookMark(bmReg); <----Aqui da el error

Slds.

ecfisa 24-05-2012 21:02:31

Hola.

A partir de Delphi 2009 GetBookmark devuelve un puntero a TBytes.

Probá haciendo:
Código Delphi [-]

var
  bmReg: TBookmark;  // <== este cambio
begin
  ...
  bmReg := GetBookmark;
  try
    sPredAnt := FieldByName( 'Prede' ).AsString;
    if (sPredAnt = 'P') or Locate('Prede', 'P', []) then
    begin
      Edit;
      FieldByName( 'ImagenPrede' ).Assign( TBitmap.Create );
      FieldByName( 'Prede' ).AsString := ' ';
      Post;
    end;
  finally
    GotoBookMark(bmReg);
  end;
...

Saludos.

Edito: No podía encontrar el artículo donde lo había leido, lo acabo de ubicar : Release Notes for Delphi 2009 ...

Jere_84 30-05-2012 00:49:05

Hice el cambio a Pointer y el error sigue dando, hice una prueba y comente estas dos lineas de mi codigo:
Código Delphi [-]
 FieldByName ( 'ImagenPrede' .) Asignar (TBitmap.Create);
 FieldByName ( 'Prede' ). AsString: = "" ;

Y el error no ocurre porque sera que al editar los campos ocurre el error: ClientDataSetCliente: Record not found.
Que método alternativo podría utilizar?


La franja horaria es GMT +2. Ahora son las 05:19:32.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi