Board index » delphi » D3 - refreshing of tables - repost

D3 - refreshing of tables - repost

I would like to know more about refreshing of tables in delphi 3.

I know that if I set local share to true I get some automatic refreshing.

But certain cases are not auto refreshed.

e.g. 1

If I have a master detail say orders - jobs

if I open another instance of jobs table and edit and post it the detail
table (jobs) in the order - jobs master detail is not refreshed, I need to
refresh it myself.

I have writte a routine for this, I call RefeshLikeTables(tablemodified);
and it refreshes all tables objects that use the same paradox.db file.

e.g. 2

It appears that if I update a table object that is not in a relationship,
then any other table objects that use the same paradox.db file are auto
updated with local share = true. All my corresponding DBComboboxLookupTables
are updated, which is handy.

I suppose that a lot of the above was intentional for some reason. It would
be good to read up on exactly how it all works.

Qu 1. Is there a way to set you own record lock or can a table lock only be
applied programmatically. What I was looking at was if a user has locked a
record and I have a bunch of records selected by another user which I wish
to set a logical field all say true can I cycle through the records and
check that any are locked, or can I try to obtain a table lock and check for
errors, or should I try and open table exclusive and check for errors.

Thanks in advance

Leon Sinagra

 

Re:D3 - refreshing of tables - repost


Paradox table records are locked automatically when you place the table in
Edit state.  To see if a record is locked:

try
  Table1.Edit;
execept
  {If you get here the record could not be locked.}
end;

Bill

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Re:D3 - refreshing of tables - repost


On Sun, 28 Feb 1999 20:04:29 +0800, "Leon Sinagra"

Quote
<sina...@nettrek.com.au> wrote:
>Qu 1. Is there a way to set you own record lock or can a table lock only be
>applied programmatically.

Leon,

If you want to place a record lock and keep it after you moved off the
record, you can use this:

  Table1.UpdateCursorPos;
  Check(DbiGetRecord(Table1.Handle, dbiWriteLock, nil, nil));

This lock must be manually released by placing the record pointer of
TTable on the locked record and calling:

  Table1.UpdateCursorPos;
  Check(DbiRelRecordLock(Table1.Handle, False));

HTH,

Jan

Other Threads