Validating identy importing updating betwee access and excel
I needed to convert to so here is my code if anybody needs a conversion in a hurry: Public Function parse Id No(By Val id No As String) As Boolean Try Dim a As Integer = 0 For i As Integer = 0 To 5 a = CInt(id No.
Substring(i * 2, 1)) Next Dim b As Integer = 0 For i As Integer = 0 To 5 b = b * 10 CInt(id No.
We all know that female ID numbers start with the number 0 after date of birth and the male ID numbers start with the number 5.
Regards, Willem Hi Guys, I tried to find a SQL Implementation of this function but Google failed me but I still know one exists. Let me know what you think:-- =============================================-- Author: Craig Peacock-- Create date: 08/10/2007-- Description: This will validate a SA ID Number-- =============================================ALTER PROCEDURE [dbo].[VAL_S01_Validate SAIDNumber] @IDNumber VARCHAR (13)ASBEGIN /* This function was created from the function posted at: DECLARE @A INT -- ~Holds Negative Index numbers DECLARE @B INT -- ~Holds Positive Index numbers DECLARE @C INT DECLARE @D INT -- ~The check digit DECLARE @I INT -- ~Counter Variable SET @D = -1 SET @A = 0 SET @B = 0 BEGIN TRY PRINT 'Getting Negative Numbers____________________' SET @I = 0 WHILE (@I 0) BEGIN SET @C = @C @B % 10 SET @B = @B / 10 END --WHILE SET @C = @C @A SET @D = 10 - (@C % 10) IF (@D = 10) SET @D = 0 IF (CAST(SUBSTRING(@IDNumber, 13, 1) AS INT) = @D) RETURN 1 ELSE RETURN 0 END TRY BEGIN CATCH RETURN 0 END CATCH RETURN 0END Willem and Craig, I tried the SQL previously on the blog and it worked (old and new numbers).
Craig's one doesn't seem to work though (unless it is a SQL version problem). It would appear that the tried and trusted rules don't work for ID numbers of people born after 1/1/2000.
Regards Jan['validate-id', 'You have entered an invalid identity number', function (v) ] Hi, please can someone help with out with this problem: The second last digit in my driver's licence is DIFFERENT to that in my green ID book. Here's my code: CREATE OR REPLACE FUNCTION CS_VALID_SA_ID_NUMBER ( p_id_number IN VARCHAR2 ) RETURN BOOLEANAS lv_A NUMBER := 0; -- ~Holds Negative Index numbers lv_B NUMBER := 0; -- ~Holds Positive Index numbers lv_C NUMBER; lv_D NUMBER := -1; -- ~The check digit lv_I NUMBER; -- ~Counter Variable lv_is_valid NUMBER; lv_the_number NUMBER; lv_rply BOOLEAN := FALSE; BEGIN--Getting Negative Numbers lv_I := 0 ; IF (lv_I 0) THEN lv_C := lv_C lv_B mod 10; lv_B := lv_B / 10; END IF;lv_C := lv_C lv_A;lv_D := 10 - (lv_C mod 10); IF (lv_D = 10) THEN lv_D := 0; END IF;lv_the_number := CAST(SUBSTR(p_id_number, 13, 1) AS NUMBER); IF lv_the_number = lv_D THEN lv_is_valid := 1; lv_rply := TRUE; END IF; RETURN lv_rply; -- ************************************ -- ** Handle an unexpected exception ** -- ************************************ EXCEPTION /* When this function throws an exception outside its exception block via the exception procedure will it catch its own exception.
For example, the last three digits in my driver's licence is 050 --- but in my ID it is 084This causes endless confusion. Id # to the picture and name of the person on it so I know if the person I am dealing with is legitimate or just using an valid ID # with his picture on it . I'm trying to convert Craig Peacocks SQL version to PL/SQL function and not getting anywhere. To avaoid this the following statement is required.