Solved

Paradox Lock Files...

Posted on 2001-06-25
4
384 Views
Last Modified: 2007-12-19
Hi Guys,
   Does anyone know how I can find out how many locks paradox has at any one time?

I think there is a 64 limit or something.  I would like to check the count so I can see what portion of some code (rather crap code) is locking more tables.

Cheers
Woody.
0
Comment
Question by:WoodyJ007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 6224482
just found this, at borland, and somewhere i have a sample too

BDE API Examples (DbiOpenLockList)
Creates an in-memory table containing a list of locks acquired on the table.
--------------------------------------------------------------------------------

Return a list of locks acquired on a specific table:

This example is included with Delphi in the BDE32.HLP file.


meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6224724
from the mentioned helpfile, don't forget to add the bde-unit into the uses clause

Return a list of locks acquired on a specific table.

This example uses the following input:

  fDbiOpenLockList(Table1, LockList);

The procedure is:

procedure fDbiOpenLockList(Tbl: TTable; var LockList: TStringList);

var
  TmpCursor: hdbicur;
  Lock: LOCKDesc;
  rslt: dbiResult;
begin
  Check(DbiOpenLockList(Tbl.handle, True, True, TmpCursor));
  Check(DbiSetToBegin(TmpCursor));
  LockList.Clear;
  repeat
    rslt:= DbiGetNextRecord(TmpCursor, dbiNOLOCK, @Lock, nil);
    if (rslt <> DBIERR_EOF) then begin
      LockList.Add('Lock Type: ' + IntToStr(Lock.iType));
      LockList.Add('User Name: ' + StrPas(Lock.szUserName));
      LockList.Add('Net Session: ' + IntToStr (Lock.iNetSession));

      LockList.Add('Session: ' + IntToStr (Lock.iSession));
      LockList.Add('Record Number: ' + IntToStr (Lock.iRecNum));
    end;
  until (rslt <> DBIERR_NONE);
  Check(DbiCloseCursor(TmpCursor));
end;
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6225390
about the limt, it depends on the paradoxversion but is about 1024 for one table
0
 

Author Comment

by:WoodyJ007
ID: 6226759
Just the job.

I was trying to close this yesterday but the EE server was down for ages!

Cheers
Woody.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month4 days, 4 hours left to enroll

630 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