Board index » delphi » Accessing TField's Value property problem

Accessing TField's Value property problem


2005-08-09 08:54:30 AM
delphi177
The situation:
1) I have a TDBGrid connected to a dataset through a data source.
2) I attempt to access a TField's Value in the current row of the dataset,
converting it to a particular type.
3) The conversion throws an exception, which I catch, because the Value is
invalid for that type. ( The invalid value is some bad data that has made its
way into a record of a Paradox table. )
4) The underlying TDBGrid puts out a message about the error. This happens even
when I have the dataset's DisableControls() called at the time of the exception.
I do not want 4) to happen, especially as I have caught the exception and
handled it. Is there any way to keep the TDbGrid from displaying the error message ?
 
 

Re:Accessing TField's Value property problem

Set the DBGrid.DataSource property to nil.
--
Bill Todd (TeamB)