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. Database & SysAdmin
  3. Database
  4. CRecordset::Open error - Connection is busy with results for another hstmt

CRecordset::Open error - Connection is busy with results for another hstmt

Scheduled Pinned Locked Moved Database
databasehelpquestionc++announcement
1 Posts 1 Posters 3 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.
  • G Offline
    G Offline
    Gaul
    wrote on last edited by
    #1

    I get the error "Connection is busy with results for another hstmt" when I call the CRecordset::Open on an SQLServer database. The code has been working for several years on WATSQL (now Sybase SQLAnywhere) until I switched the database recently to run on SQLServer. Does anyone have an idea what is going on, or what options I may need to set to get rid of this. For instance, in the code below, line (1.) works without problem, while line (2.) fails giving the error above. Both statements were failing on ::SQLExecute(m_hstmt) inside MFC; 1. if (!m_pAssetSet->Open(CRecordset::snapshot)) DisplayError(); 2. if (!m_pAssetypeSet->Open(CRecordset::snapshot)) DisplayError(); Also, when I switch the code to call Open with default arguments, both Open statements work, but then my Add/Edit/Update on m_pAssetSet fails right in the bowels of MFC with SQLSetPos on line (1.) as follows: ::SQLSetPos(m_hstmt, 1, wPosOption, SQL_LOCK_NO_CHANGE); The second error message is something to the effect that an option is invalid. Does anyone have any idea what is causing this? Why should I be getting this even when I call CRecordset::Open with default arguments. Any suggestions?

    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