Hi, I dont know if this is the proper forum to ask this question but I need some answer. I'm trying to update a record with an TAdsQuery delphi component, so I have AdsQuery.ExecSql command to execute but in too few ocasions that record is blocked or edited by another user, so I get error 5035. I've also have the code within a TRY..EXCEPT ( delphi ) command and within a transaction, and still gets the error. Any idea how can avoid this error to produce ?? Thanks so much.

asked 05 Mar '15, 08:36

lbidi's gravatar image

lbidi
325323441
accept rate: 14%


If the record is locked by another user there is nothing that can be done until the other user releases the lock or an administrator kills the connection to clean it up.

If you are having this issue because of edits within the same application this is likely expected if you are mixing TAdstable and TAdsQuery within the same transaction. See KB 020923-1503

I hope the above answers your question. Or are you asking how to catch the error and re-try silently in the application?

EDIT:

Responding to comment regarding catching the error.

I don't currently have access to Delphi, but I think you can do something similar to the following

Try
AdsQuery1.ExecSQL;
Except on E: EDatabaseError do
 if ( E is EAdsDatabaseError ) then
 begin
   if ( E.SQLErrorCode = 5035 ) then
   begin
    /*Do something here*/
    end;
  end;
end;
link

answered 05 Mar '15, 09:32

Edgar%20Sherman's gravatar image

Edgar Sherman
5.4k13185
accept rate: 25%

edited 05 Mar '15, 14:13

Hi Edgar, thanks for the KB, but if you can give some idea how to catch this error, I will be very grateful.

(05 Mar '15, 09:38) lbidi

Thanks so much, Edgard

(06 Mar '15, 03:22) lbidi
Your answer to the original question.
If responding to a request for additional information, please edit the question or use the comment functionality.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×325
×271

Asked: 05 Mar '15, 08:36

Seen: 2,597 times

Last updated: 06 Mar '15, 03:22

Advantage Developer Zone Contact Us Privacy Policy Copyright Info


Powered by Advantage Database Server and OSQA
Disclaimer: Opinions expressed here are those of the poster and do not necessarily reflect the views of the company.