Solved

Operation not allowed when the object is closed

Posted on 2014-10-14
4
186 Views
Last Modified: 2014-10-19
We are using a Delphi TClientDataSet to propagate changes from a local database to a remote SQL Server on our website server.  We open the set of records on the local database and open a ClientDataSet with the data from SQL Server.  We compare the two and update the ClientDataSet where required.  These changes are then applied back to the SQL Server database by calling ApplyUpdates.  This has been working fine for a while , but now we are getting the error

Operation not allowed when the object is closed

when attempting to call ApplyUpdates on the ClientDataSet.  No changes have been made to the code or the local environment and we are getting the same error in the development site and on the client's site.

Any ideas!! We are using Delphi 6 and a TADOConnection to the SQLServer, running under Windows 7 Prof 32 bit.

Roger Graham
0
Comment
Question by:rogerfg7
  • 2
4 Comments
 
LVL 32

Expert Comment

by:ste5an
ID: 40379582
D6? Cool. And daring :) Afaik this error means that the connection is no longer active/valid.
0
 
LVL 25

Expert Comment

by:Sinisa Vuk
ID: 40379835
Do you use TSocketConnection component?
Check for property Connected of TSocketConnection before do Apply.
0
 

Accepted Solution

by:
rogerfg7 earned 0 total points
ID: 40380231
ste5an: We're at the cutting edge of antiquated IDEs, besides, we have a long and fruitful relationship.  <Afaik this error means that the connection is no longer active/valid.>  We gathered that from the message, my question is why has this now started happening, presumable some change at the SQL Server end.  Are there any ADO connection parameters or additional code that will get around this.  My understanding of applying updates to a clientdataset/datasetprovider/query is that the whole remote databse process is sorted out via the AS_ApplyUpdates function in the IAppServer interface.

Sinisa Vuk: We are not using a remote server, the ADO query, DateSetProvider and ClientDataSet are all within the app, hence no TSocket in use.

Managed to narrow down the location of the exception to the CommitTrans command on the ADO connection after our updates. As the ApplyUpdates process should handletrnasactions,  I have removed this as it does not seem to affect to update of the server.  So I now regard this question as closed

Many thanks for your comments.
0
 

Author Closing Comment

by:rogerfg7
ID: 40389791
Further investigation showed where the error was being caused and we were able to do a work-around.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now