CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 CCS 1.0 how to count record in result grid

Print topic Send  topic

Author Message
nong
Posted: 06/17/2002, 12:51 AM

when i query from table i get some result recordset and how i count the number of recordset please show me the code in asp format in CCS 1.0
thank you
Nicole
Posted: 06/18/2002, 5:47 AM

Hello,
it requires some manual code in form Before Show event. Here are the steps you should follow: (e.g. for ASP)
1. Add Label from Forms tab e.g. next to navigator on the form.
2. open page code and find line countSQL variable value id built and assign alias to "count(*)":
CountSQL = "SELECT COUNT(*) as rec_num " & _

3. Put following code to form Before Show event:
Dim rs1
Dim res
if <form_name>.DataSource.Where <> "" then
Set rs1 = <form_name>.DataSource.Connection.execute(<form_name>.DataSource.CountSQL & " WHERE " & <form_name>.DataSource.Where)
else
Set rs1 = <form_name>.DataSource.Connection.execute(<form_name>.DataSource.CountSQL)
end if
while not rs1.EOF
res = CCGetValue(rs1, "rec_num")
<form_name>.<Label_field_name>.Value = res
rs1.movenext
wend

Do not forget to replace <form_name> and <Label_field_name> with real names
nong
Posted: 06/18/2002, 7:44 PM

thank you very much for your code , i try for your code it work thank..

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.