AW: [ASP] RS.recordCount

Johann Voelker activeserverpages at glengamoi.com
Tue, 21 Dec 2004 21:51:16 +0100


Also, mit'm MS SQL Server krieg ich auch mit 'Recordset.Open =
sSQL,connection,3,3'
ein '-1' für Recordset.recordcount (ich machs dann halt immer mit =
'Count(*) AS Anzahl').

Frage an die Spezialisten in der Liste: Warum ist das so?

Gruß Johann


> -----Original Message-----
> From: activeserverpages-admin@glengamoi.com 
> [mailto:activeserverpages-admin@glengamoi.com] On Behalf Of 
> Marcus Gnaß
> Sent: Tuesday, December 21, 2004 6:27 PM
> To: activeserverpages@glengamoi.com
> Subject: Re: AW: [ASP] RS.recordCount
> 
> On 14 Dec 2004 at 10:37, Thomas Bandt wrote:
> 
> > > Ich hab mal was unter VBA gemacht, da hatte ich das gleiche 
> > > Problem. Irgendwo stand, daß die 
> > > Eigenschaft RecordCount erst dann zuverlässig belegt ist, 
> > > wenn vorher mittels Schleife über das 
> > > RecordSet gelaufen wurde.
> > > Probiers mal aus, vielleicht hilfts.
> 
> > Nee, das ist Quatsch.
> 
> Nicht ganz!
> 
> If you have done a recordcount on the rows in your database I 
> bet you are wondering how there 
> could be -1 records in your database. The simple answer is 
> that there can't be - 1. The problem is 
> that you have used the wrong cursor. As all the records of 
> the database have to be stepped 
> through and then the cursor has to be returned to the 
> beginning of the recordset, the default 
> which is the forward only cursor won't work. The simple 
> solution is to use a more dynamic cursor 
> rather than a forward only cursor.
> 
> Quelle: http://www.codefixer.com/tutorials/recordcount.asp
> 
> Marcus
> _______________________________________________
> ActiveServerPages Mailingliste, Postings senden an:
> ActiveServerPages@glengamoi.com
> An-/Abmeldung und Suchfunktion unter:
> http://www.glengamoi.com/mailman/listinfo/activeserverpages
>