Recent

Author Topic: Dataset navigation #2  (Read 1352 times)

TRNelson

  • Jr. Member
  • **
  • Posts: 64
Dataset navigation #2
« on: February 07, 2016, 01:05:07 am »
Is there a way of advancing the current record point by more than one record in a similar fashion as using SQLQuery.Next, SQLQuery.Prior, etc?

On a related note, where can you find a comprehensive description of SQLQuery?

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 824
Re: Dataset navigation #2
« Reply #1 on: February 07, 2016, 03:29:44 am »
hello,
for this you can use the moveBy function.
For example to move to 2 records forward :
Code: Pascal  [Select][+][-]
  1.  SQLQuery1.MoveBy(2);    

to move to 2 records backward :
Code: Pascal  [Select][+][-]
  1.  SQLQuery1.MoveBy(-2);    

TSQLQuery is a subclass of TDataset. You can see the TDataset functions here

Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

TRNelson

  • Jr. Member
  • **
  • Posts: 64
Re: Dataset navigation #2
« Reply #2 on: February 07, 2016, 06:37:12 am »
hello,
for this you can use the moveBy function.
For example to move to 2 records forward :
Code: Pascal  [Select][+][-]
  1.  SQLQuery1.MoveBy(2);    

to move to 2 records backward :
Code: Pascal  [Select][+][-]
  1.  SQLQuery1.MoveBy(-2);    

TSQLQuery is a subclass of TDataset. You can see the TDataset functions here

Friendly, J.P
Thank you for both bits of information. 

Very helpful!

 :)

 

TinyPortal © 2005-2018