Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDatabase processing

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I’ve just starting learning a bit about CDatabase & CDaoDatabase. I’ve been able to get CDaoDatabase working without too many problems but I’ve found using CDatabase a real pain.
My situation is this; I have a simple little program that allows the user to add records to a database (ODBC), plus I have a listbox showing the records created so far. When the user adds a record I then trigger off the routine for displaying that record in the listbox (by extracting it’s details from the database), but it doesn’t find it!, unless I add a Sleep after the code where the record is created. In other words it appears that I am asking for details of the record before it’s creation is completed.
Is there any way to get the system to wait for the database processing to complete before moving on to the next statement in my program? I’m new to DB programming so I’m probably missing something obvious. Any help would be much appreciated.
Thanks.
 
what is the actual code? I seem to remember using BeginTrans and CommitTrans with CDatabase and also calling Requery as well. Also, AddNew seemed to work fine but Update did not do what I needed (that was why I went the BeginTrans/CommitTrans route)

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top