|
-
October 21st, 1999, 08:39 AM
#1
Requery not working for me
I have a db app up and working. Appwizard generated a toolbar that has arrows that steps through the records. This all works.
I also have a second thread that is doing inserts to the database independent of my interface thread. The problem is that the new records added after that app started are not in the recordset. The docs say use requery. When I call requery() when one of the buttons is pushed it breaks the recordset. ODBC returns the error:
"Field can't be updated. No rows updated or deleted"
It is an access db. After that the buttons don't work at all. They return this error message:
"Invalid cursor position; no keyset defined"
Any ideas how I do this properly?
Here is my call that breaks everything:
void CMySampleView::OnRecordFirst()
{
if (m_pSet->CanRestart())
{
if (!m_pSet->Requery())
AfxMessageBox("Error: requery failed");
}
else
AfxMessageBox("Cannot restart");
OnMove(ID_RECORD_FIRST);
}
-
October 25th, 1999, 09:52 AM
#2
Re: Requery not working for me
Hi, use MoveFirst to go to the first record.
-
October 25th, 1999, 12:44 PM
#3
Re: Requery not working for me
That didn't help either....same message.
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
|