We are in the process of migrating the Spacial Wiki content to our new Help Center at spacial.com.
Please visit the Help Center for latest Tips and Tricks, Documentation and Troubleshooting.
spacial.com/help-center

TDataSet

From SpacialAudio

Jump to: navigation, search

Link To Other PAL Articles



TDataSet

Properties and Methods


Contents

Properties

Declaration

property Values[Fieldname: String]: Variant; default;

Description

Read/Write

Use the Values property to read or set the field values for a record.

The dataset must be in edit mode before values can be changed.



Query function example



Display the list of songs that played during the last 20 minutes.

 
var D : DateTime; 
var Q : TDataSet;  

D := T['-00:20:00']; 
Q := Query('SELECT * FROM songlist WHERE date_played >= :time ORDER BY date_played DESC',[D],False); 

Q.First; 
while not Q.EOF do 
begin 
 WriteLn(Q['filename']); 
 Q.Next; 
end; 

Q.Free; 




Methods

BOF
EOF
APPEND
Cancel
Edit
First
Insert
Delete
Last
Next
Post
Previous


BOF

Declaration

function BOF: Boolean;

var D : DateTime; 
var Q : TDataSet;  
D := T['-00:20:00']; 
Q := Query('SELECT * FROM songlist WHERE date_played >= :time ORDER BY date_played DESC',[D],False);
If Q.BOF then // the beginning of the query results
   WriteLn(Q['filename']);


Description

Returns True if the dataset is on the first record.


EOF

Declaration

function EOF: Boolean;
Description

Returns True if the dataset is on the last record.

var D : DateTime;
var Q : TDataSet;

D := T['-00:20:00'];
Q := Query('SELECT * FROM songlist WHERE date_played >= :time ORDER BY date_played DESC',[D],False);
Q.First;
while not Q.EOF do
begin
WriteLn(Q['filename']);
Q.Next;
end;
Q.Free;



Append

Declaration
procedure Append;

Description
Add a new record to the end of the dataset.


Cancel

Declaration
procedure Cancel;

Description
Abort any changes made to the record.


Edit

Declaration
procedure Edit;

Description
Put the dataset in Edit mode. (Allows you to change the record values)


Personal tools