Solved

Paradox Lock Files...

Posted on 2001-06-25
4
371 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
  • 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

14 Experts available now in Live!

Get 1:1 Help Now