Paradox Community

Items in pnews.paradox-programming

Subject:Re: Record Unlocking
Date:Thu, 21 Jun 2018 18:30:09 -0700
From:Peter <peter@whiteknight.email>
Newsgroups:pnews.paradox-programming
Hmm, been doing some thinking and observing since I posted this question.

It seems that the problem is only the last defined field that has been 
changed and focus remains on the field, ie not departing.

The button I click has TabStop property set to False so focus would not 
leave the field and therefore the record would be locked by Pdox? But 
the status bar does not have a "Locked" mssg.

So if that were the case maybe all I have to do is find out which field 
has focus and issue an unlockRecord()?

Update:
Well that didn't work either

I used a tc.currRecord()and that seems to have solved the problem so far.

I have no idea why the table and the tcursor cannot sync up with resync, 
nor why the tcursor is not up to date when I issue an unlock.

On 06/21/2018 12:50 PM, Peter wrote:
> I have been fighting a stubborn issue of not being able to post/unlock a 
> record. Finally found the problem and have been able to make a fix but 
> it is clumsy and I hope someone can provide an alternative.
> 
> I have a form and several tables in the datamodel. The one table (call 
> it tableA) at issue is not linked.
> 
> Several fields on the form are defined from tableA
> 
> I use a tc.dmAttach("TableA") to make changes to records as well as 
> unlocking. The problem I ran into is that after unlocking the data would 
> not post to the table.
> 
> I tried TableA.dmResync(tc) - did not solve the problem
> I tried dmResync(TableA,tc) - did not solve the problem
> I tried field.unlockRecord (using one of the defined fields)and that 
> worked when that field had been changed.
> 
> I then tried field.unlockRecord() for all defined fields and that 
> worked, as such:
> field1.unlockRecord()
> field2.unlockRecord()
> field3.unlockRecord()
> field4.unlockRecord()
> more...
> tc.unlockRecord()
> 
> What seems to happen is that if a defined field's value has been changed 
> then it needs a distinct unlock/post record
> 
> So, is there a way to unlock all the define fields of a single table (in 
> the datamodel) in one statement instead of independantly?
> 
> ps I also put a self.unLockRecord() in the :depart: method of each 
> defined field and that worked also, again clumsy I think.


Copyright © 2004 thedbcommunity.com