Welcome! Log In Create A New Profile

Advanced

Detect Event in a Table Control

Posted by Aelfassi 
Aelfassi
Detect Event in a Table Control
January 05, 2009 11:52AM
Hi everybody,

I'm using a memory Table control and I would like to know if there is a possibility to detect if the row is added or modified and from there I cas insert or update my record.

Thanks for your feedback.
Fabrice Harari
Re: Detect Event in a Table Control
January 05, 2009 12:44PM
Hi Aelfassi

I think I remember there was a property of the table (..Modified?) but I would not rely on it in any case for the following reason:
- if it's a MODIFIED line, you will need to read the corresponding record before modifying its values, therefore you will need to have a unik key in the table somewhere to find it...
- if it's an ADDED line, you will either have entered a value for this unik key, or you are using an AUTOID...

In any case, you have a value somewhere that allows you to search for the record...

Therefore, when you exit the line, you do a hreadseek for the record, and if you find it, it's an edit, if not it's an ADD...

THAT will also take care of the problems of:
- several users creating the same record at the same time (if you are NOT using autoIDs)
- one user DELETING a recordand another one trying to modify it afterward (the record will be reCreated)

Best regards

Fabrice Harari
WinDev, WebDev, WinDev Mobile consulting
"Michel HERRSCHER".pcs.crosspost
Re: Detect Event in a Table Control
January 05, 2009 01:30PM
From my own knowlegde : No.

I always add an hidden column to my memory tables where, by code, I note
what I have to do to Add/Update/ Delete lines of my database.

HNY2009,

HTH
--
Michel HERRSCHER Consultant
tel : +33450870912

Message forwarded from pcsoft.us.windev
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: