Solved

Preventing edit, insert and delete

Posted on 1997-11-19
2
147 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
2 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
Comment Utility
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
Comment Utility
Thank you Zifnab.
It works.

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now