Validation in a data entry form

I want to know what is a typical code of validation for a data entry form and in which event I must attach it.
For example I have my form has fields
numeric-integer,real numbers,alphanumeric-string 20 and some of them I want to be required.
Usually I use a DBgrid component for data entry is this right? if not what is better way and which code is necessary.
If is possible to have an example.
vage78Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
StefaanConnect With a Mentor Commented:
Hi,

I have sent you a new version of the DBSample project I created for you.  This time I hope there arn't anymore Delphi 5 components in it.

I have also included the Executable in the ZipFile.

Best regards,


Stefaan
0
 
MotazCommented:
You can put validation in the Paradox table, for example maximum value, minimum, and default values
0
 
StefaanCommented:
Hi,

Just a little note here.  From my point of view, I wouldn't recommend to use a DBGrid for entering record information.

Personally I have creaded a template DB Form (from which all my DBForms inherit) with a PageControl which has at least 2 TabSheets.  The first TabSheet (which is the RecordView) has a DBGrid which is Read Only.  From this view the user can see all the records or he can filter the results.  When double clicking on a record in the grid, the user gets the List View tabsheet on which he can edit the record using DataAware controls.  Also when the user clicks on the Insert or Edit button of the TDBNavigater the ListView tabsheet is shown to the user.

Well, this is only my personal input on this matter, but IMHO (and I think some other experts will agree with me) you shouldn't use a DBGrid for editing or entering data.

Best regards,


Stefaan
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
vage78Author Commented:
Edited text of question.
0
 
vage78Author Commented:
Is it possible to have an example, Stefaan?
0
 
StefaanCommented:
Hi,

Well, if you can supply me with an e-Mail adress, I could set up a little sample for you.
0
 
vage78Author Commented:
OK, Stefaan
my e-mail adress is billi200@hotmail.com
Thank you very much
0
 
StefaanCommented:
Hi,

One more question, do you have the RxLib components ? My sample uses the grid from that library, but if you don't have the library, I'll use the default delphi DBGrid.
0
 
mullet_attackCommented:
Just an opinion...

I mostly use grids for user input, especially Infopower grid with combo's etc embedded. For me, this gives the best use of screen 'real estate', and previous records shown in the grid prompt novice users as to what sort of data the grid is expecting (for new records.)

There, I've had my two cents worth... :-)
0
 
vage78Author Commented:
Stefaan, I use the default DBGrid componenet.
Thanks
0
 
vage78Author Commented:
Stefaan, I use the default DBGrid componenet.
Thanks
0
 
StefaanCommented:
Hi,

Well I have sent a saple to your e-mail adress.  It only contains the source code and is only 45 Kb.

If you have any questions, feel free to ask them.

Best regards,


Stefaan.


(Only use the second zip file, in the first I forgot to put the grid in ReadOnly)
0
 
mrissmannCommented:
We do not use grids for data entry.  We use components such as TDBEdit and such.  We actually derived from these and added an inputrequired published field (or you can use different tag values).  On the before post you can cycle through the controls for that datasource and do your validation like required fields, validate the data...

Mark
0
 
vage78Author Commented:
May I have a simple example, Mark.
Thank you
0
 
vage78Author Commented:
Thank you Stefaan
0
 
mrissmannCommented:
Do you still want an example?

Mark
0
 
vage78Author Commented:
Yes, Mark
But if you can it must be simple with input validation
bye
0
All Courses

From novice to tech pro — start learning today.