Solved

Preventing edit, insert and delete

Posted on 1997-11-19
2
150 Views
Last Modified: 2010-04-04
How can i prevent edit, insert and delete on some records
in dbgrid.
I work with the dbnavigator and dbgrid.

0
Comment
Question by:gipa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1350962
Well you can check for an OnStateChange or an OnUpdate (events of your DataSource).
In these events you can check which record is active and then change the state of the table to what you want. I think OnStateChange is better then OnUpdate.
Haven't tried this out. But I think it's a good idea and should work.

You can also use the Before or After Insert, Edit Delete events of TTable component.
0
 

Author Comment

by:gipa
ID: 1350963
Thank you Zifnab.
It works.

OnstateChange
  if .... then
    DataSource1.DataSet.Cancel;
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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