PDA

Click to See Complete Forum and Search --> : User Id Generation


Sep 11th, 2000, 09:20 AM
Can someone please help.

I have created an online registration form in ASP, which is working fine. However, I would like to generate their Unique Identifier from the fields that they enter. Typically these are First Name, Last name, Address, Town, County, Country, Post Code and Telephone Contact.

One of the suggestions would be

First 2 of First Name
Last 3 of Last Name
Last 3 of Post Code

I could use a 'IF EXISTS' clause to add an incremental suffix to the value.

However, if you had a Mark and a Mary Smith who are living in the same house, you get a slight problem.

NOTE: they cannot have joint subscriptions, and I don't want to offer them the chance to enter their own id value.

Is their any existing code that jumbles this up to provide something unique ?

Any help would be appreciated

Serge
Sep 11th, 2000, 12:59 PM
Have you ever thought of creating another field in the table of the database that will hold the ID of each record. If you use Access database then you need to create a field with Autonumber data type. If you use SQL Server, then you can use Identity type of Integer. This will keep track of all records by assigning the unique ID for each record.

Sep 12th, 2000, 07:41 AM
It is a consideration, but I think it is far better to reduce the number of Id's in a table, and to have id's that can have some meaning.

Thanks for your help.

Does anyone have any code for jumbling up parameters into a user_id ?

Sep 12th, 2000, 03:22 PM
As I thought. I had hoped there might be an alternative to this problem. I was hoping to avoid using the 'IF EXISTS' clause in the commandtext property of the ActiveX Data Object.

However, thank-you for your help.

H

Serge
Sep 12th, 2000, 03:44 PM
If you follow the Relational Database Concept, then you will use ID which identifies each record. Because If you don't then when database has more then one table with common information, then you will end up having redundant information in many tables.