Ado Help
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
    Location
    Kuwait
    Posts
    44

    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.

    Regards,
    Satish:

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    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:
    TRy
    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

This is a CodeGuru survey question.


Featured


HTML5 Development Center