Using ADS 11.1x with data dictionaries and Delphi. If a record is locked is there a way to find which computer (User) have a lock on a record. Thanks.

I tried the following but get an access violation.

var
myTable: String;
ulRetVal: Cardinal;
usLockType, usStructSize: pWord;
stUserInfo : pADS_MGMT_USER_INFO;
begin
     usStructSize := pWord(SizeOf(ADS_MGMT_USER_INFO));
     myTable := DataM1.CSIDatabase.GetConnectionPath + '\' + CusTbl.TableName +'.adt' );

     ulRetVal := AdsMgGetLockOwner(DataM1.CSIDatabase.ConnectionHandle, PAnsiChar(myTable),       RecordNum,@stUserInfo, @usStructSize, @usLockType);

if ulRetVal = AE_SUCCESS then
  ShowMessage(Format(CusTbl.FieldByName('Name').AsString + ' is Locked by user [%s]', [stUserInfo.aucUserName]));

asked 09 Apr '15, 14:01

KimHJ's gravatar image

KimHJ
516343950
accept rate: 16%

edited 13 Apr '15, 05:19

Jens%20M%C3%BChlenhoff's gravatar image

Jens Mühlenhoff
1.3k51037


link

answered 10 Apr '15, 03:57

Joachim%20Duerr's gravatar image

Joachim Duerr
8.7k1031133
accept rate: 18%

Thanks,the SQL link is not valid, but I'm fine with the API link.

(10 Apr '15, 12:33) KimHJ

I tried but I get an access violation and the ulRetVal is 9083 I have edit my queastion

(10 Apr '15, 14:42) KimHJ

ages ago I've written a TAdsTable descendant which you can still find in the archives of ADS: http://devzone.advantagedatabase.com/dz/content.aspx?Key=17&SearchKeyWords=tadstableex&tab=-1. Take it as a base (iirc this one was not unicode aware).

(11 Apr '15, 06:53) Joachim Duerr

Link didn't work. I found the SQL version in the old news forum that works fine.

(13 Apr '15, 18:58) KimHJ
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:

×271
×172
×55

Asked: 09 Apr '15, 14:01

Seen: 2,612 times

Last updated: 13 Apr '15, 18:58

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.