Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ADO Seek method

ADO Seek method

Scheduled Pinned Locked Moved C / C++ / MFC
databasedata-structurestutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    ldaoust
    wrote on last edited by
    #1

    Hi, I am trying to use the Seek method in an ADO recordset object. It works fine if the index is only one field. For an index with multple fields, say two strings, I cannot seem to make it work properly. MSDN says that the first argument is a Variant array. example code: _variant_t varKeys[2]; varKeys[0] = "value1"; varKeys[1] = "value2"; m_pRecordset->Seek( varKeys, adSeekFirstEQ ); What happens is that only the first value seems to taken into account. Any ideas ? note: I am using an MDB (Access) database. Opening using Jet4 conenct string. thanks, Louis.

    J 1 Reply Last reply
    0
    • L ldaoust

      Hi, I am trying to use the Seek method in an ADO recordset object. It works fine if the index is only one field. For an index with multple fields, say two strings, I cannot seem to make it work properly. MSDN says that the first argument is a Variant array. example code: _variant_t varKeys[2]; varKeys[0] = "value1"; varKeys[1] = "value2"; m_pRecordset->Seek( varKeys, adSeekFirstEQ ); What happens is that only the first value seems to taken into account. Any ideas ? note: I am using an MDB (Access) database. Opening using Jet4 conenct string. thanks, Louis.

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      ldaoust wrote: MSDN says that the first argument is a Variant array. It seems like rather than an array of variants, what you need is a single variant containing an array of values. Check this article[^]. -- jlr http://jlamas.blogspot.com/[^]

      L 1 Reply Last reply
      0
      • J Jose Lamas Rios

        ldaoust wrote: MSDN says that the first argument is a Variant array. It seems like rather than an array of variants, what you need is a single variant containing an array of values. Check this article[^]. -- jlr http://jlamas.blogspot.com/[^]

        L Offline
        L Offline
        ldaoust
        wrote on last edited by
        #3

        Great, thanks. Got it to work based on that article. thanks again. -- Louis.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups