lock a Table

I'm working on a DBgrid and I'm having some trouble with a table : How can I lock the table for insert ? I would like to modify the existing records but I don't want insert new one. Second question : How can I check the data insered ??  If I set the EditFormat of a TIntegerField it doesn't work.
gianlucaAsked:
Who is Participating?
 
kretzschmarConnect With a Mentor Commented:
hi gia,

as i said, you have nothing to do for locking records, this does the bde for you automatically, when the record comes in editstate, and releases the lock when the changes are saved(posted).

if you want to lock the whole table, so that only one can open it, then set just before opening the exclusive-property of the ttable-component to true.

hope that helps

meikl
0
 
kretzschmarCommented:
hi gianluca,

if u use paradox or dbase or access,
you've nothing additional to for locking a record,
the bde does it for u.

what for an editformat did you apply?
(the editformat comes only during editing this field,
if you want it for display, then do it in the displayformat or displaymask)

meikl
0
 
gianlucaAuthor Commented:
I have a paradox table, I first add some record then (in another form) I just want the user change the value of this records, but I don't how to do.

yes, I want control what the user is editing, but editformat does not works.
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
kretzschmarCommented:
hi gia
can you show the editformat you want to apply?
meikl
0
 
gianlucaAuthor Commented:
I want limit the user edit to 3 digits, so I set the "editformat" of the TNumericField to "###", but in the DBgrid (that I use to edit the table) I can write anything (more than 3 digits).
0
 
kretzschmarCommented:
hi gia,

an editformat does not limit the input in a tnumericfield, it defines only the inputformat, unlike the editmask in a tstringfield.

to limit the input you can set the min and max property, which will validated by leaving this field.

meikl

0
 
gianlucaAuthor Commented:
Thanks kretzschmar for your answer; regarding the first question (how to lock a table) I don't know how to do it.
0
All Courses

From novice to tech pro — start learning today.