I am having a problem using ADO. Sometimes when I open a recordset using ADO I get the recordcount as -1. I open a recordset in the following way:
rs.open "select * from account",cn,<adopendynamic> or <adopenstatic> ,adlockoptimistic
when I check the recordcount it shows -1. There are records in the recordset.
As far as I know, whenever records are returned in the recordset the recordcount property contains for the total count of records.
Whenever it shows -1, I am not able to use the properties in the recordset
i.e. Recordcount, movenext, movefirst etc. etc.
What could be the problem. Do you have any idea.
Recordsets returned might not be of the expected type on serverside cursors.
It is not all in the hands of the developer: when you ask for a
dynamic or static recordset, the Provider might not be able to
retrive it that way - it has to deal with the Db...Unless you use a clientside cursor:
CursorLocation = adUseClient
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.