?
Solved

Preventing edit, insert and delete

Posted on 1997-11-19
2
Medium Priority
?
152 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month8 days, 6 hours left to enroll

764 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