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..
|
|
|
 |
|