Home | Advertising Info79 USERS CURRENTLY ONLINE   
   Site Search Contact Us Friday, March 14, 2025  
 
 


 
ASPProtect
User Management Application with web based screens that allow you to manage users.
www.ASPProtect.com
 
ASPBanner
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
www.ASPBanner.com
 
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
www.ASPPhotoGallery.com
 
ASPClassifieds
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.
www.ASPClassifieds.com



DISCUSSION ARCHIVES
 



We didn't realize
the site was so popular.

Other Stuff
 

 
 
Active Server Pages what is asp programming how to sample asp example code scripts software asp forum mail sessions applications global.asa CJWSoft ASPProtect ASPBanner ASPClassifieds



(Advanced)  (Components)  (Database)  (General)  (Vbscript)




ASPProtect

 
Subject: RecordCount Problems
From: Pete
Date: 2/17/1999 4:34:00 AM
IP: 193.133.140.50



 

Im trying to just do a fancy bit of code that just displays a) how many records have been found b) which record you are currently at

The code example below is a cut down version but it show what Im trying to do. As my browser and server locked up if I executed a SQL query that returned tomany records Ive tried to use MaxRecords to limit the amount to 20.

Trouble Im having is that RecordCount seems to always be returned as -1 and therefore is being displayed as Unknown. This even happens when less then 20 records are returned which really makes me scratch my head!

Any ideas? If so can you explain any alterations and why you did them rather then just giving me the code, so I know what it does etc :)

<%
Declare Varibles
Dim DataConn
Dim CmdRS
Dim SQL
Dim Count

Count = 0

Set connection to Database
Set DataConn = Server.CreateObject("ADODB.Connection")
Set CmdRS = Server.CreateObject("ADODB.Recordset")

Open DB
DataConn.Open "DSN=incident"

SQL = "SELECT tablbase.* FROM tablbase"

Submit SQL statement
CmdRS.Maxrecords = 20
CmdRS.Open SQL, DataConn
%>

<body>
<h4>Query results :
<% If CmdRS.Recordcount = -1 then
response.write "Unknown Number Of"
Else
response.write CmdRS.recordcount
End If%> Records Returned</h4>

<% While NOT CmdRS.EOF
count = count + 1%> </p>

Record <%=count%> Of <% If CmdRS.Recordcount = -1 then
response.write "Unknown"
Else
response.write CmdRS.recordcount
End If%>

<!--Display Record Set Data Here-->

<% CmdRS.MoveNext
Wend %>

Thanks in advance

Pete

Follow Up - Re: RecordCount Problems - Harlan 2/17/1999 8:39:57 AM

Follow Up - Re: From the book - Harlan 2/17/1999 11:11:07 AM

Follow Up - Re: RecordCount Problems - Raymond Skorstad 8/26/1999 7:43:35 AM


 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

PowerASP active server pages asp.net microsoft .net framework sdk learn asp what is asp tutorial learn asp.net CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com