» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > ASP forums and Tips

ASP forums and Tips Talk about ASP Scripting. .net and Cold Fusion as well.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-08-2005, 08:15 AM
lardy lardy is offline
OSP Starters
 
Join Date: Dec 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
lardy is on a distinguished road
Default Record Count ?

Hi,
i couldnt count the number of records, i have this table:

table:

id | acct
1 Administrator
2 Accounting
3 Administrator

<Code:>
<!-- #include file="p_conn.asp" -->
<%
dim rsadmin,sqladmin,u,x


u="Administrator"

set rsadmin=server.createobject("adodb.recordset")
sqladmin="select * from users where acct='"&Administrator&"'"

rsadmin.open sqladmin,conn,1,3

do while not rsadmin.eof
x=1

x=x+1

rsadmin.movenext
loop


%>
Total Admin=<%=x%>

</Code:>

it only writes Total Admin! the x value is missing -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 12-08-2005, 08:19 AM
jami jami is offline
OSP Starters
 
Join Date: Dec 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jami is on a distinguished road
Default Code

You can just use:

Code:

set rsadmin=server.createobject("adodb.recordset")
sqladmin="select * from users where acct='"&Administrator&"'"
rsadmin.open sqladmin,conn,1,1

response.write rsadmin.recordcount

It works very well as i always use it. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS Historical Facts servomapper64 General Talk 1 08-25-2006 07:33 AM
next and previous record from table lucky7 PHP Programming and Tips 3 08-19-2006 11:22 AM
How does Overture count relate to Google search count? robotec Google 6 08-15-2006 06:53 PM
Record set problem in ASP bexter ASP forums and Tips 1 08-15-2006 03:07 PM
count help? blanc MySQL Forums 0 08-03-2006 04:49 PM


All times are GMT. The time now is 04:45 PM.