CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Ado Help

  1. #1
    Join Date
    Jun 2002

    Ado Help

    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.


  2. #2
    Join Date
    Jul 2000
    Milano, Italy
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.