Board index » delphi » HELP: How to validate field in DBGrid?

HELP: How to validate field in DBGrid?

How do I validate a field in a DBGrid before it gets posted to the
database?  Is there a way to intercept the entry and change the field data
before it goes to the database?

Thanks.
-----------------------------------------------------------------
  \   "Confucius say,
   \       man who eat crackers in bed wake up feeling crummy!"
  o/\_                              
 <\__)\    Andy Seitz
  ">   |  
   `    \  internet: se...@sdd.hp.com
-----------------------------------------------------------------

 

Re:HELP: How to validate field in DBGrid?


Yes there is Ultimately you can use the before post event of the query

but  you may prefer the onchange event of the field

or the ondatachange of the Tdatasource  

It depends on your app which is best for you  but the best advise is to
keep
the event you use consistent throughout the app as finding the validation
when there are so many posibilities
can prove tiresome.

Andy Seitz <se...@sdd.hp.com> wrote in article
<01bc22b4$7cacd350$14793c0f@hpsdv063>...

Quote
> How do I validate a field in a DBGrid before it gets posted to the
> database?  Is there a way to intercept the entry and change the field
data
> before it goes to the database?

> Thanks.
> -----------------------------------------------------------------
>   \   "Confucius say,
>    \       man who eat crackers in bed wake up feeling crummy!"
>   o/\_                              
>  <\__)\    Andy Seitz
>   ">   |  
>    `    \  internet: se...@sdd.hp.com
> -----------------------------------------------------------------

Other Threads