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. CRecordset : Debug Assertion Failures with edit/update/addnew

CRecordset : Debug Assertion Failures with edit/update/addnew

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasedebugginghelptutorial
1 Posts 1 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.
  • S Offline
    S Offline
    Stefan_L_01
    wrote on last edited by
    #1

    Hi I use odbc-access driver in c++ and have a crecordset, created with the adress of a database. I can use my CRecordset-pointer m_pRS to navigate through the set, but whenever i want to edit, update, add or delete something from the recordset (like m_pRS->Edit(); ) i get a debug assertion failure (visual c++ 6.00) Here is the initializing code for the recordset: // neu initialisieren mit aktueller Datenbank CRecordset *rs = new CRecordset(&m_DB); m_pRS = rs; m_hStmt = m_pRS->m_hstmt;; SDWORD b1; SDWORD b2; SQLBindCol (m_hStmt, 1, SQL_C_CHAR, (PTR)m_mAkt.m_sName, sizeof(m_mAkt.m_sName), &b1); SQLBindCol (m_hStmt, 2, SQL_C_DOUBLE, (PTR)&m_mAkt.m_fDichte, sizeof(m_mAkt.m_fDichte), &b2); SQLBindCol (m_hStmt, 3, SQL_C_CHAR, (PTR)m_mAkt.m_sBeschreibung, sizeof(m_mAkt.m_sBeschreibung), &b1); try { m_pRS->Open( CRecordset::snapshot, _T("SELECT * FROM Material ORDER BY Materialname, Dichte"), CRecordset::none); // Recordset durchzaehlen GetMaterialNum(); } catch ( CDBException *pDBE) { AfxMessageBox("Database Fehler: "+pDBE->m_strError); return false; } Can someone help me why navigating (calling for example m_pRS.MoveNext(); )works, but not .Edit() , .Update(), .AddNew and so on? Thank you niklas

    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