[Gambas-user] Database: Events BeforeSave(...) and BeforeDelete(...)

Hans Lehmann hans at gambas-buch.de
Mon Jul 15 08:56:11 CEST 2019


Hello.

For a SQLite database project for our online book - in which all field
types are used - I would like to insert an image (field type db.Blob)
for each record. I also want to use the most important control elements
from the component gb.db.form (DataSource, DataBrowser with navigation
bar (New, Save, Update, Delete, Forward, Backward, Start and End),
DataControl, DataCombo).

I would like to implement the following:

(1)
Before saving a new or changed dataset, it should be determined whether
an image has already been saved. If this is NOT the case, the image
should be saved after an image selection dialog.

(2)
Before deleting a dataset, you should ask whether the dataset should
actually be deleted. At the moment the data record is deleted
immediately without any further inquiry!

For both tasks the two events BeforeSave( Data As Result ) and
BeforeDelete( Keys As Variant[] ) are obvious. But I have no idea how to
handle both tasks with it? Can anyone help with ideas or even source code?

Yours sincerely

Hans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190715/41208ca8/attachment.html>


More information about the User mailing list