Solved

Validation in a data entry form

Posted on 2000-05-01
17
286 Views
Last Modified: 2010-04-04
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.
0
Comment
Question by:vage78
  • 8
  • 5
  • 2
  • +2
17 Comments
 
LVL 7

Expert Comment

by:Motaz
Comment Utility
You can put validation in the Paradox table, for example maximum value, minimum, and default values
0
 
LVL 3

Expert Comment

by:Stefaan
Comment Utility
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
 

Author Comment

by:vage78
Comment Utility
Edited text of question.
0
 

Author Comment

by:vage78
Comment Utility
Is it possible to have an example, Stefaan?
0
 
LVL 3

Expert Comment

by:Stefaan
Comment Utility
Hi,

Well, if you can supply me with an e-Mail adress, I could set up a little sample for you.
0
 

Author Comment

by:vage78
Comment Utility
OK, Stefaan
my e-mail adress is billi200@hotmail.com
Thank you very much
0
 
LVL 3

Expert Comment

by:Stefaan
Comment Utility
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
 
LVL 2

Expert Comment

by:mullet_attack
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:vage78
Comment Utility
Stefaan, I use the default DBGrid componenet.
Thanks
0
 

Author Comment

by:vage78
Comment Utility
Stefaan, I use the default DBGrid componenet.
Thanks
0
 
LVL 3

Expert Comment

by:Stefaan
Comment Utility
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
 

Expert Comment

by:mrissmann
Comment Utility
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
 

Author Comment

by:vage78
Comment Utility
May I have a simple example, Mark.
Thank you
0
 
LVL 3

Accepted Solution

by:
Stefaan earned 10 total points
Comment Utility
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
 

Author Comment

by:vage78
Comment Utility
Thank you Stefaan
0
 

Expert Comment

by:mrissmann
Comment Utility
Do you still want an example?

Mark
0
 

Author Comment

by:vage78
Comment Utility
Yes, Mark
But if you can it must be simple with input validation
bye
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now