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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
kretzschmarCommented:
hi gia
can you show the editformat you want to apply?
meikl
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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
kretzschmarCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.