Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2004, 12:29 AM
Authorized User
 
Join Date: Nov 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to eapsokha
Default Recordcount in Global.asa

I have used the RecordCount property in the Global.asa file but it doesn't work; returning -1 value. Does anyone can help me please?

Many thanks

__________________
Mr. Sokha Eap
Webmaster
UNDP Cambodia
 
Old February 27th, 2004, 02:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I am not sure what the Global.asa file has to do with this. Are you creating an ADODB.Recordset? Is that what the RecordCount property is referring to?

If so, make sure you open the Recordset in such a way that it supports the RecordCount. Not every Recordset does that. For example, a Read-Only, Forward-Only Recordset will always return -1 as the RecordCount.

Take a look here: http://www.adopenstatic.com/faq/recordcounterror.asp to see how you can fix this. Also, make sure you check out the alternatives to RecordCount here: http://www.adopenstatic.com/faq/reco...ternatives.asp.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 27th, 2004, 04:09 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

Are you simply trying to get a record count of a running recordset? Try including something in your recordset like...

sql = "SELECT Count(Field1) as RecordCount, Field2, Field3 FROM Table"

and so on.






Similar Threads
Thread Thread Starter Forum Replies Last Post
About Global.asa pbcatan Classic ASP Databases 2 December 4th, 2006 12:40 AM
Global.asa gmoney060 Classic ASP Basics 3 September 25th, 2004 09:11 AM
GLOBAL.ASA zaeem Classic ASP Databases 3 November 4th, 2003 09:13 AM
Global.asa madsmad ASP.NET 1.0 and 1.1 Basics 1 August 17th, 2003 07:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.