Solved

Paradox Lock Files...

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 99
How to call a form that is in a DLL  from an application? 13 71
Printing problem 2 92
Firemonkey android show image from resource ? 1 42
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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