|
-
May 24th, 2007, 09:53 PM
#1
Thread Starter
Addicted Member
Double Validate
Hi,
I know we all do on the spot validate (keypress event, change event, validate event, etc). But before data collected save to databases should we do validate again?
Thanks.
-
May 25th, 2007, 04:28 AM
#2
Lively Member
Re: Double Validate
I only ever validate just before the data is entered into the database, just because the user might see his/her error beforehand.
The answer though is no, so long as you are certain that invalid data cannot be entered into the input controls. If for example, you validate a textbox on Change, invalid data can never be entered into that box, so it seems a waste of time to validate again.
If, somehow, I help you, please rate the post using the scales icon in the left bar <----  .
Please Use Naming Conventions in your projects! ------\/
http://www.visibleprogress.com/vb_na...onventions.htm
Me to Brother
-Hey, look at this avater I made in about 5 seconds
-What, morrisons?
-AGHHHHHH
-
May 25th, 2007, 06:24 AM
#3
Re: Double Validate
 Originally Posted by barianto
Hi,
I know we all do on the spot validate (keypress event, change event, validate event, etc). But before data collected save to databases should we do validate again?
This is a question that is best answered by you and the needs of your application.
Do you feel an extra validation step is necessary? If yes, then do so. If no, then do not.
The answer to this question will not be the same from one app to another.
-
May 25th, 2007, 11:08 AM
#4
Re: Double Validate
I consider it a bad practice to rely on the user interface to validate data that's going into a database. Application layers should perform their own validation independently of each other.
-
May 25th, 2007, 11:23 AM
#5
Re: Double Validate
 Originally Posted by Moneybucks
The answer though is no, so long as you are certain that invalid data cannot be entered into the input controls.
"Invalid data", as far as the particular database is concerned, might be missing data. For instance, in a POS application, the amount paid is verified as a valid currency amount, but "no entry" would be invalid for a payment operation, so that would have to be verified at the time the data is saved.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
May 28th, 2007, 10:03 PM
#6
Thread Starter
Addicted Member
Re: Double Validate
 Originally Posted by Hack
This is a question that is best answered by you and the needs of your application.
Do you feel an extra validation step is necessary? If yes, then do so. If no, then do not.
The answer to this question will not be the same from one app to another.
I think you are right Hack, 
And i "feel" to boost my confidence, extra validation step is always necessary.
-
May 28th, 2007, 11:37 PM
#7
Re: Double Validate
 Originally Posted by Moneybucks
I only ever validate just before the data is entered into the database, just because the user might see his/her error beforehand.
The answer though is no, so long as you are certain that invalid data cannot be entered into the input controls. If for example, you validate a textbox on Change, invalid data can never be entered into that box, so it seems a waste of time to validate again.
You may want to consider reading up on n-tier design principles.
-
May 28th, 2007, 11:42 PM
#8
Re: Double Validate
 Originally Posted by Penagate
I consider it a bad practice to rely on the user interface to validate data that's going into a database. Application layers should perform their own validation independently of each other.
I agree this...I always do the validation just before the save takes place...I dont write any validation in the Lost_Focus or Change event, I validate the input only when the Save Button is pressed...
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
May 29th, 2007, 08:36 AM
#9
Re: Double Validate
Both methods are valid....it pretty much depends on indvidual tastes and application needs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|