dwelsh
|
| Posted: 11/11/2002, 9:02 AM |
|
I am trying to get a RecordsCount, but I cannot get this to work.
ASP/VB templates with CCS.
Function Order_Header_DataSource_AfterExecuteSelect()
'Custom Code @109-73254650
' -------------------------
Count = Order_Header.DataSource.RecordsCount
' -------------------------
'End Custom Code
End Function
Am I placing this code in the right event? "AfterExecuteSelect"
dwelsh
|
|
|
 |
Bill
|
| Posted: 11/11/2002, 3:14 PM |
|
Take a look at the Counting Sheep Tip by Imranz http://www.gotocode.com/art.asp?art_id=230&
|
|
|
 |
dwelsh
|
| Posted: 11/12/2002, 5:55 AM |
|
I have and thats not going to work, besides being a really sloppy apporach for something that should be retreviable via the classes.
|
|
|
 |
GreggB
|
| Posted: 11/12/2002, 8:31 AM |
|
First, if your using ASP, the Property is "RecordCount (ASP)" not "RecordsCount(PHP)".
The way I use "RecordCount" is as follows:
1. Open the page with the form you wish to have a total record count. This form is usally a grid form. Within that page I sometimes create a separate form to display just the record count.
2. Select a place on the grid form where you would like the record count to be displayed. Using the Toolbox, select the Forms Tab, Select "Label" to insert a new label. Optional: Rename the label to count or total_count.
3. Select the Label Properties and set the following:
a. Control Type = "Code Expression"
b. Control Source = Recordset.RecordCount()
c. Data Type = Integer
That's it
Hope this help even though it doesn't seem the direction you want to go.
Greggb
|
|
|
 |
dwelsh
|
| Posted: 11/12/2002, 1:08 PM |
|
I would love to know why the counting sheep example is sloppy... it simply calles the CodeCharge created recordcount function directly using the default value. As simple as pie.
|
|
|
 |
imranz
|
| Posted: 11/12/2002, 1:11 PM |
|
Sorry, the post above wasn't by dwelsh. I was copy/pasting the topic and accidentally pasted the author.
|
|
|
 |
TimX
|
| Posted: 11/14/2002, 6:23 AM |
|
Hello,
Please refer to new KB article at support site: http://support.codecharge.com/kb_article.asp?article_id=45
to fins how to calculate records count.
|
|
|
 |
imranz
|
| Posted: 11/14/2002, 7:35 AM |
|
Personally I think the solution mentioned in the counting sheep example is much quicker and simpler, and it still takes into account the Where clause.
http://www.gotocode.com/art.asp?art_id=230&
I don't see a reason to do it as described in the Yes knowledge board example.
|
|
|
 |
Capelino
|
| Posted: 12/03/2002, 8:11 PM |
|
I tried this using PHP, and it did not work.
Label Properties:
- Name: totals
- Source Type: Code Expression
- Control Source: $DBConnection1->RecordsCount
- Data Type: integer
This just shows 0 (zero) on label field.
What does it wrong ?
Thanks.
|
|
|
 |
iffiz
|
| Posted: 07/16/2003, 12:18 AM |
|
CCDLookUp("COUNT(*)", "directory_items", "category_id="&CCToSQL(category_id,"integer"), DBConn)
|
|
|
 |