CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Location
    Scotland
    Posts
    143

    Angry Attempting to scroll before or after the data

    trying to access the db of access using VC++, my main view class is derived from CRecordView, I think the recordset should be always available to use without having to call m_pSet->Open().

    I call m_pSet->MoveFirst() in the view class, get the error like

    Attempting to scroll before or after the data

    and I tested the m_pSet->IsBOF() , which returns true!

    I suspect that the resultset is empty or closed somehow. Please help, I will wait online

  2. #2
    Join Date
    Apr 2004
    Posts
    76
    Hi floatingkent,

    Perhaps a MFC Sample application will help you understand your task.

    See http://msdn.microsoft.com/library/de...mfc_enroll.asp.

    Also, a typical enumeration is below.

    Jeff

    Code:
    if ( ! m_pSet->IsOpen() )
        m_pSet->Open();
    
    if( m_pSet->IsBOF() )
    {
        AfxMessageBox( "Table is Empty!");
        return;
    }
    m_pSet->MoveFirst();
    while ( ! m_pSet->IsEOF() )
    {
        CString str = m_pSet->m_Description ;
        
        m_pSet->MoveNext();
    }
    Last edited by jwalto1; July 13th, 2004 at 06:01 PM.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured