|
-
July 13th, 2004, 05:02 PM
#1
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
-
July 13th, 2004, 05:58 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|