Preventing insert, update and deletes
- From: "Mikael Lenfors" <mikael@xxxxxxxxxx>
- Date: Tue, 22 Aug 2006 17:58:21 +0200
Hello!
I have a security setting giving users access to insert, update or delete
records. I'm trying to implement this in the easyest way. Of cource I can
change the buttons in my DBNavigator but I would prefer to have some common
code for all my tabels. I'w tried to use the ADOQuery.BeforeInsert as
example. When the event triggers I can check if the user has accessright to
add and if not show a message and abort, the only problem is - How do I
abort in this case?
The following code did not work....
Procedure TMyForm.OnBeforeInsert(DataSet: TDataSet);
Begin
If Not AccessAdd Then
Begin
ShowMessage('You do not have access right to create this record!');
ADOQuery.Cancel; // <- What code goes here?
End;
End;
Regards, Mikael
.
- Follow-Ups:
- Re: Preventing insert, update and deletes
- From: Bill Todd
- Re: Preventing insert, update and deletes
- Prev by Date: Re: Problems with ADO and Multithreading: List Index Out Of Bounds
- Next by Date: Filtering ADO from other form. Problem
- Previous by thread: Can't use '*' in TADODataset.Filter
- Next by thread: Re: Preventing insert, update and deletes
- Index(es):