Validation Checks that the data entered is sensible.

Slides:



Advertisements
Similar presentations
Character Arrays (Single-Dimensional Arrays) A char data type is needed to hold a single character. To store a string we have to use a single-dimensional.
Advertisements

Computer Science & Engineering 2111 Text Functions 1CSE 2111 Lecture-Text Functions.
1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction 9.2Streams 9.3Formatting Output with printf 9.4Printing Integers 9.5Printing Floating-Point.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Copyright © 2012 Pearson Education, Inc. Chapter 4: Making Decisions.
Chapter 9 Formatted Input/Output Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
JavaScript, Third Edition
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
Chapter 7. 2 Objectives You should be able to describe: The string Class Character Manipulation Methods Exception Handling Input Data Validation Namespaces.
Entering Data in Excel. Entering numbers, text, a date, or a time n 1Click the cell where you want to enter data. n 2Type the data and press ENTER or.
IWBAT compare and order positive and negative numbers.
 2007 Pearson Education, Inc. All rights reserved C Formatted Input/Output.
1 Chapter Two Using Data. 2 Objectives Learn about variable types and how to declare variables Learn how to display variable values Learn about the integral.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Streams Streams –Sequences of characters organized.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Chapter 9 Formatted Input/Output Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
 2005 Pearson Education, Inc. All rights reserved Formatted Output.
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
CHƯƠNG 3 Finding, Filtering, and Formatting Data.
Lesson 2.  To help ensure accurate data, rules that check entries against specified values can be applied to a field. A validation rule is applied to.
Chapter 3 Processing and Interactive Input. 2 Assignment  The general syntax for an assignment statement is variable = operand; The operand to the right.
Input, Output, and Processing
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 1-1 LINKS TO OBJECTIVES Design Tables and Fields Design Tables and Fields Data Types Field Size Property.
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
Copyright © 2012 Pearson Education, Inc. Chapter 4: Making Decisions.
Introduction to Engineering MATLAB – 2 Introduction to MATLAB - 2 Agenda Defining Variables MATLAB Windows.
Making Decisions. 4.1 Relational Operators Used to compare numbers to determine relative order Operators: > Greater than < Less than >= Greater than.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
AS computing Validation and verification. Introduction It is important to maintain the integrity of any database of information. Any data item must always.
Introduction to Database using Microsoft Access 2013 Part 6.1 November 18, 2014.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 4: Making Decisions.
Verification & Validation. Batch processing In a batch processing system, documents such as sales orders are collected into batches of typically 50 documents.
CSCI 330 UNIX and Network Programming Unit IV Shell, Part 2.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
Chapter 9: Completing the Basics. In this chapter, you will learn about: – Exception handling – Exceptions and file checking – The string class – Character.
C How to Program, 7/e © by Pearson Education, Inc. All Rights Reserved.
An Introduction to Regular Expressions Specifying a Pattern that a String must meet.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
A FIRST BOOK OF C++ CHAPTER 14 THE STRING CLASS AND EXCEPTION HANDLING.
Microsoft Access Prepared by the Academic Faculty Members of IT.
Lecture 6 – Selection FTMK, UTeM – Sem /2014.
Creating Advanced Queries and Enhancing Table Design.
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
MS Access: Defining Data Entry Rules Instructor: Vicki Weidler Assistant: Joaquin Obieta.
Formatting in VB Please see speaker notes for additional information!
OPERATORS IN C CHAPTER 3. Expressions can be built up from literals, variables and operators. The operators define how the variables and literals in the.
INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.1 November 16, 2014.
Random Functions Selection Structure Comparison Operators Logical Operator
MICROSFTACCESS tables. DATA TYPES Field TypeWhat It Holds Short Text Text up to 255 characters long (including spaces and punctuation). Use a Text field,
DAY 20: ACCESS CHAPTERS 5, 6, 7 Larry Reaves October 28,
Microsoft Visual Basic 2010 CHAPTER FOUR Variables and Arithmetic Operations.
28 Formatted Output.
Chapter 4: Making Decisions.
Variables and Arithmetic Operations
Validation Rules BCS-CA2-4 Students will use database software to create, edit & publish industry appropriate files.
Databases part 2 – field properties
Chapter 4: Making Decisions.
Chapter 4: Making Decisions.
Variables and Arithmetic Operations
Chapter 6 Variables What is VBScript?
How can errors in data occur when using an ICT system?
Foreign key (FK) is defined as follows:
MS ACCESS.
Validation Rules BCS-CA2-4 Students will use database software to create, edit & publish industry appropriate files.
Presentation transcript:

Validation Checks that the data entered is sensible

Input masks

0 User must enter a digit (0 to 9). 9 User can enter a digit (0 to 9). # User can enter a digit, space, plus or minus sign. If skipped, Access enters a blank space. L User must enter a letter. ? User can enter a letter. A User must enter a letter or a digit. a User can enter a letter or a digit. & User must enter either a character or a space. C User can enter characters or spaces. The character you select depends on your Microsoft Windows regional settings. > Coverts all characters that follow to uppercase. < Converts all characters that follow to lowercase. ! Causes the input mask to fill from left to right instead of from right to left. \ Characters immediately following will be displayed literally. "" Characters enclosed in double quotation marks will be displayed literally.

Tasks LEVEL 1 Create an input Mask for a Postcode LEVEL 2 Create an input Mask for a car registration LEVEL 3 User enters a first or last name with the first letter automatically capitalised. LEVEL 4 Or Own INPUT MASK

EXPRESSION BUILDER A mathematical expression that checks that the data added is valid and within a ‘valid’ range =Now()

EXPRESSION BUILDER

Validation

OperatorDescriptionExampleComment =Equal to=100Only a number of 100 is accepted <>Not equal to<>0Any number except 0(zero) is accepted <Less than<250Numbers less than 250 are accepted. 250 is not accepted <=Less than or equal to <=250Numbers less than 250 are accepted. 250 is also accepted. >Greater than>1234Numbers greater than 1234 are accepted is not accepted. >=Greater than or equal to >=1234Numbers greater than 1234 are accepted is also accepted

Validation Validation ruleComment >#17/10/03#Only dates later than 17 October 2003 are accepted, but not that date itself. <>#09/02/92#Any date is accepted except 9 February 1992 <=#26/11/95#Only dates earlier than 26 November 1995 are accepted, as is the date itself. =Date()Only today’s date is accepted. <Date()Only dates before today’s date are accepted. Today’s date is not allowed. >=Date()Only today’s date, or any future date, is accepted.

To do this...Validation Rule for FieldsExplanation Accept letters (a - z) onlyIs Null OR Not Like "*[!a-z]*" Any character outside the range A to Z is rejected. (Case insensitive.) Accept digits (0 - 9) onlyIs Null OR Not Like "*[!0-9]*" Any character outside the range 0 to 9 is rejected. (Decimal point and negative sign rejected.) Letters and spaces onlyIs Null Or Not Like "*[!a-z OR "" ""]*"Punctuation and digits rejected. Digits and letters onlyIs Null OR Not Like "*[!((a-z) or (0-9))]*" Accepts A to Z and 0 to 9, but no punctuation or other characters. Exactly 8 charactersIs Null OR Like "????????"The question mark stands for one character. Exactly 4 digits Is Null OR Between 1000 And 9999For Number fields. Is Null OR Like "####"For Text fields. Positive numbers onlyIs Null OR >= 0Remove the "=" if zero is not allowed either. No more than 100%Is Null OR Between -1 And 1 100% is 1. Use 0 instead of -1 if negative percentages are not allowed. Not a future dateIs Null OR <= Date() address Is Null OR ((Like AND (Not Like "*[,;]*")) Requires at least one at least one character, dot, at least one character. Space, comma, and semicolon are not permitted. You must fill in Field1Not Null Same as setting the field's Required property, but lets you create a custom message (in the Validation Text property.) Limit to specific choices Is Null OR "M" Or "F" It is better to use a lookup table for the list, but this may be useful for simple choices such as Male/Female. Is Null OR IN (1, 2, 4, 8)The IN operator may be simpler than several ORs. Yes/No/Null fieldIs Null OR 0 or -1 The Yes/No field in Access does not support Null as other databases do. To simulate a real Yes/No/Null data type, use a Number field (size Integer) with this rule. (Access uses 0 for False, and -1 for True.)

Tasks LEVEL 1 Create a validation rule for Male and Female LEVEL 2 Create a validation rule for a numerical field (above or below a certain number) LEVEL 3 Create your own validation rule

DATA VALIDATION LISTS