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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error "object was open"

Status
Not open for further replies.

garwain

Programmer
Jan 30, 2002
461
CA
I have just found a new bug with my program. I have a master-detail relationship between 2 queries and it seems that if I make a change to a detail record, then change records on the master dataset I will get a nice little popup saying "Object was open" and my detail dataset will end up closed.

All research that I've done so far into this points fingers at ADO. Is there any known solution for this? I have read every news group artical I could find and have searched through MSDN for hours without finding a solution.

Any help would be appreciated.
 
Hi garwain,

Have you tried closing the master detail
before making the change? It could be that
because its kinda like two threads trying
to access the same resource at the same time!
It results in a deadlock. Maybe closing the master
database connection is enough, but then you'll
have unupdated information in your master, so
I guess thats out of the question ;-)

I hope this helps, BobbaFet

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com

&quot;<beer brand> is like making love in a cano...
it's <f-word + ing> close to water !!!&quot;
- Monty Python's Flying Circus, 1969/70
 
I have been playing around with this most of the day, and it now seems that it has something to do with server side cursors (which I have to use)

I can change records in the master dataset as long as I have not selected a record in the dbgrid for the detail dataset. As soon as I select a record in the detail grid and try changing records in the master I get &quot;Object was open&quot;.

I have &quot;fixed&quot; this by removing the master/detail relationship and coding it manually by updating the parameter in the detail dataset and requerying it when the master dataset record changes. I don't like the solution, and I cant seem to reproduce the problem in another program.

Anyway the problem is &quot;solved&quot; at least for now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top