CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 how to find record count

Print topic Send  topic

Author Message
pradyun123

Posts: 8
Posted: 01/19/2008, 10:25 PM

i hv a database name project and a table receiptentry ............ i want to find recordcount.
using recordcount

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open="C:\inetpub\wwwroot\manohari\project.mdb"
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT * FROM receiptentry"
rs.Open sql,conn
if rs.Supports(adApproxPosition)=true then
i=rs.RecordCount
response.write("The number of records is: " & i)
end if
rs.Close
conn.Close
%>

this returns i=-1 when the table is empty........ and when i manually updated 5 records then also it returns i=-1.......... wht is the problem with this code................ Anyone can help........... plz i will be thankful to u.
_________________
asp,ado's
View profile  Send private message
DonB
Posted: 01/20/2008, 4:02 AM

select count(*) AS TotalRecords, * from receiptentry

--
DonB

http://ccswiki.gotodon.net


"pradyun123" <pradyun123@forum.codecharge> wrote in message
news:64792e94dd0613@news.codecharge.com...
>i hv a database name project and a table receiptentry ............ i want
>to
> find recordcount.
> using recordcount
>
> <%
> set conn=Server.CreateObject("ADODB.Connection")
> conn.Provider="Microsoft.Jet.OLEDB.4.0"
> conn.Open="C:\inetpub\wwwroot\manohari\project.mdb"
> set rs=Server.CreateObject("ADODB.recordset")
> sql="SELECT * FROM receiptentry"
> rs.Open sql,conn
> if rs.Supports(adApproxPosition)=true then
> i=rs.RecordCount
> response.write("The number of records is: " & i)
> end if
> rs.Close
> conn.Close
> %>
>
> this returns i=-1 when the table is empty........ and when i manually
> updated 5
> records then also it returns i=-1.......... wht is the problem with this
> code................ Anyone can help........... plz i will be thankful to
> u.
> _________________
> asp,ado's
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

pradyun123

Posts: 8
Posted: 01/20/2008, 4:57 AM

Thanks a lot for ur reply...........
but what was the actual problem with my code.............
where the actual error is...........

_________________
asp,ado's
View profile  Send private message
Oper


Posts: 1195
Posted: 01/30/2008, 4:11 AM

RC=ccdlookup("count(*)","receiptentry"," ",DBConnection1)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message

Add new topic Subscribe to topic   


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.