Article View: borland.public.cppbuilder.database.ado
Article #3838Re: TField::OnValidate useless
From: J.Steinecker
Date: Thu, 06 Jun 2002 08:18
Date: Thu, 06 Jun 2002 08:18
47 lines
2592 bytes
2592 bytes
Hi Georgi, you can look at the VCL in dbgrids.pas and db.pas and will find, that on leaving the DBgrid column containing the TDateTimeField there will be called a procedure called TField.SetEditText. This calls the OnSetText procedure if assigned, or the standard SetText procedure which again will call the TDateTimeField.SetAsString method. Here are the calls to StrToDate, STrToTime or StrToDateTime depending on the DataType property. And here arises the exception. So, you can place your own checks in the OnSetText event instead of in the OnValidate event. HTH Juergen "J.Steinecker" <jsteinecker@gmx.de> schrieb im Newsbeitrag news:3cfdd484_1@dnews... > Hi Georgi, > I think it will be useful to know which Control you use for user input, > because i guess that problem arises at the control, not the BDE. > Juergen > > "Georgi Cholakov" <georgi.cholakov@mail.bg> schrieb im Newsbeitrag > news:3cfdb798_1@dnews... > > Hi, guys :-) > > I've tried everything to control the user input in TDateTimeField (also > > TBCDField), > > but every time when the user input is wrong a message box appears (with > > message "1.1.1 is not valid date and time." for example) > > before my checks that i wrote in OnValidate event. I want to prevent this > > message box appearance and then to take the control in my code. Does > anybody > > know how to do this? > > > > Thank you very much. > > -- > > Sincerely, > > Georgi Cholakov > > > > > > > > > >
Technical Details
Message-ID:
<3cff19c3$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!easynews!news-xfer2.newshosting.com!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!newsfeed.online.be!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3cfdb798_1@dnews> <3cfdd484_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc5f9,ab74ff14f47975e4 X-Google-Attributes: gidfc5f9,public X-Google-Thread: 10698b,34d24d013321fb6 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-06-06 01:18:53 PST From: "J.Steinecker" <jsteinecker@gmx.de> Newsgroups: borland.public.cppbuilder.database.ado,borland.public.cppbuilder.database.sqlservers References: <3cfdb798_1@dnews> <3cfdd484_1@dnews> Subject: Re: TField::OnValidate useless Date: Thu, 6 Jun 2002 10:18:55 +0200 Lines: 49 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 217.82.82.53 Message-ID: <3cff19c3$1_1@dnews> X-Trace: dnews 1023351235 217.82.82.53 (6 Jun 2002 01:13:55 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!easynews!news-xfer2.newshosting.com!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!newsfeed.online.be!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews