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.
Note the code below and the numbers 3,3. These numbers represent the constants adOpenStatic and adLockOptimistic which are the perfect cursor and locktype for a recordcount.
| Previous: Returning Top 10 records |
Next: Server.MapPath |
Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.
Get your best asp web hosting provider now and save 25%