Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Operation not allowed when the object is closed

Posted on 2014-10-14
4
Medium Priority
?
285 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 36

Expert Comment

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

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Integration Management Part 2

971 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