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