Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
Test on empty dataset |
Thu, Feb 28 2013 11:00 AM | Permanent Link |
Christian Ahlgrimm | Hallo,
has someone already found out, how to test, if a dataset returns no records ? (replacement for dataset.recordcount). I didn't found it here.... hopefull christian |
Thu, Feb 28 2013 11:14 AM | Permanent Link |
Alvaro | Hi Christian:
Try this: property EOF: Boolean Usage Indicates whether the row pointer is on the last row in the set of rows in the dataset. This property is only set to True if the Last method is called, the row pointer attempts to navigate beyond the last row using the Next method, or if the dataset is empty. Alvaro |
Thu, Feb 28 2013 12:48 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Christian,
<< has someone already found out, how to test, if a dataset returns no records ? (replacement for dataset.recordcount). I didn't found it here.... >> http://www.elevatesoft.com/manual?action=viewprop&id=ewb1&comp=TDataSet&prop=RowCount Tim Young Elevate Software www.elevatesoft.com |
Fri, Mar 1 2013 5:37 AM | Permanent Link |
Christian Ahlgrimm | Thanks all for your help, next time I will spend more time in reading...
But: next problem: my goal was to inform the user about the number of records of a sql-dataset. I put the rowcount in a panel.caption with the following procedure. But the rowcount is rigth only from then second time of execution the procedure. After first execution the rowcount is wrong, procedure: mydataset.Params.Clear; mydataset.Params.Add ('_name =''' +trim (label2.caption) +''''); database.load(mydataset); mydataset.first; if mydataset.rowcount=0 then window.alert('nothing !') else begin panel1.caption:=inttostr(mydataset.rowcount)+' records'; panel1.visible:=true; end; any iIdea's ? christian |
Fri, Mar 1 2013 5:57 AM | Permanent Link |
Walter Matte Tactical Business Corporation | This Code needs to be moved to the AfterLoad event of the MyDataset. mydataset.first; if mydataset.rowcount=0 then window.alert('nothing !') else begin panel1.caption:=inttostr(mydataset.rowcount)+' records'; panel1.visible:=true; end; You cannot program the same way you do in delphi.... when you call database.load(mydataset); it doesn't wait for the code to execute, (it can't ... got to get to the server etc.) Use the AfterLoad. Walter Christian Ahlgrimm wrote: Thanks all for your help, next time I will spend more time in reading... But: next problem: my goal was to inform the user about the number of records of a sql-dataset. I put the rowcount in a panel.caption with the following procedure. But the rowcount is rigth only from then second time of execution the procedure. After first execution the rowcount is wrong, procedure: mydataset.Params.Clear; mydataset.Params.Add ('_name =''' +trim (label2.caption) +''''); database.load(mydataset); mydataset.first; if mydataset.rowcount=0 then window.alert('nothing !') else begin panel1.caption:=inttostr(mydataset.rowcount)+' records'; panel1.visible:=true; end; any iIdea's ? christian |
This web page was last updated on Friday, November 1, 2024 at 07:01 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |