Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus-es / 2009-06

SQLQuery y uso de Bookmark

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Abraham

Bueans amigos, me podrian indicar por favor como utilziar correctamente el uso de bookmark del SqlQuery

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 [?]

-------------------
Abraham Monta�o
abraham.montano en gmail.com
Chiclayo - Per�
Tel: 074-214324
Cel: 074-979034545
---------------------
------------ pr�xima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus-es/attachments/20090625/c0c991c6/attachment.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.freepascal.org/pipermail/lazarus-es/attachments/20090625/c0c991c6/attachment.png>

Reply by email

javivf
to Abraham

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

Show quoted text 20 lines
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;
Show quoted text 17 lines
------------------- 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.freepascal.org/pipermail/lazarus-es/attachments/20090626/69559f14/attachment.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.freepascal.org/pipermail/lazarus-es/attachments/20090626/69559f14/attachment.png>

Reply by email