An event to cancel a SQL statement before it is run?
Posted: Thu 08 Jan 2015 09:00
I'm using the MYDac components with great success in a Delphi application pointing at a MySQL database. I have a TMyConnection, TMyQuery and a TMyCommand on a data access form that I use at loads of different points to reach the db.
I want to be able to give my users a 'demo' mode of operation where they can read from the database but not make any changes to it. I thought about going through evey form I have and conditionally skipping over any TMyQuery or TMyCommand lines that might write to the db but was worried I would miss some.
Is there an event or some other mechanism that I could use centrally on the TMyQuery and TMyCommand components on the data access page that makes them only read only or in some other way simply ignores any write or modification requests? (Without generating errors when attempting to execute modifying sql of course)
If so, can anyone give me a code snippet to illustrate how to use it.
I want to be able to give my users a 'demo' mode of operation where they can read from the database but not make any changes to it. I thought about going through evey form I have and conditionally skipping over any TMyQuery or TMyCommand lines that might write to the db but was worried I would miss some.
Is there an event or some other mechanism that I could use centrally on the TMyQuery and TMyCommand components on the data access page that makes them only read only or in some other way simply ignores any write or modification requests? (Without generating errors when attempting to execute modifying sql of course)
If so, can anyone give me a code snippet to illustrate how to use it.