[Lazarus-es] SQLQuery y uso de Bookmark

javivf javivf en gmail.com
Vie Jun 26 12:26:17 CEST 2009


Abraham escribió:
> Bueans amigos, me podrian indicar por favor como utilziar
> correctamente el uso de bookmark del SqlQuery

Hola Abraham,

Como sabes, no he usado Bookmarks extensivamente pero te paso un ejemplo
que a mi si me ha funcionado con sqlite3

>
> BM:Pointer;
>
> BM:=SqlQuery.GetBookmark;
>
>
> SqlQuery.GotoBookmark(BM);
>
>
> tambien trate de la siguiente manera
>
> BM:TBookmarkStr;
>
> BM:=SqlQuery.bookmark;
> SqlQuery.bookmark:=BM;
>
>
>
> y ninguna de las formas me regresa al registro seleccionado
>
var
  bm : TBookMark;
begin
  q.First;
  while not(q.EOF) do
    begin
      if q.FieldByName('id').AsInteger=5 then
        bm := q.GetBookmark;
      q.Next;
    end;
  DebugLn('Ultimo : ' + q.FieldByName('id').AsString); // Devuelve 7
  q.GotoBookmark(bm);
  DebugLn('Bookmark : ' + q.FieldByName('id').AsString); // Devuelve 5,
nuestro bookmark! ;)
end; 
>
>
>
> -------------------
> Abraham Montaño
> abraham.montano en gmail.com <mailto:abraham.montano en gmail.com>
> Chiclayo - Perú
> Tel: 074-214324
> Cel: 074-979034545
> ---------------------
> ------------------------------------------------------------------------
>
> _______________________________________________
> Lazarus-es mailing list
> Lazarus-es en lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus-es
>   

------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus-es/attachments/20090626/69559f14/attachment-0002.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: no disponible
Type: image/png
Size: 605 bytes
Desc: no disponible
URL: <http://lists.lazarus-ide.org/pipermail/lazarus-es/attachments/20090626/69559f14/attachment-0002.png>


More information about the Lazarus-es mailing list