How to have access generate a username and password?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to generate a username and password from data that I get from a
query. This information will be located in 2 columns - Username and Password.
The username will contain the first letter of the first five letters of the
last name. The password will contain the first letter of the first name and
the first letter of the last name, followed by the last 4 digits of the ID
number. I am not sure how to create the expression for this, or if this
should be some sort of validation rule?

I appreciate any help you can provide!
 
I presume you mean to say the first letter of the first name and the first
five letters of the last name.

(works except for the case of Sam Smith and Sally Smith then they both are
ssmith)!!!

1. username: in a query put the following: lcase(userName:
left(1,[firstName] & left(5,[Lastname]))
2. password: password: lcase(left(1,[firstName])& left(1,lastName) &
right(4,cstr([id]))

Please note, the 'scheme' proposed violates all versions of the 'right' way
to build username/password pairs.

See the requirements for strong passwords at microsoft.com

Ed Warren.
 
Thanks for the response. The usernames will also include 4 digits from a
unique ID number to avoid duplicate usernames. I have this information
plugged in to a query, but I can't seem to get it to work. I get the
following error message:

"Data type mismatch in criteria expression"

I've gone back to the table that I am using this query from and all of the
data type fileds are set to text. Am I missing something? Here is the coding
I am using for the query:

PASSWORD:

LCase(Left(1,[ScanData.FIRST_NAME]) & Left(1,[ScanData.LAST_NAME]) &
Right(4,[ScanData.SOCIAL_SEC_NUMBER]))

USERNAME:

lcase(Left(1,[ScanData.FIRST_NAME] & left(5,[ScanData.LAST_NAME])) &
Right(4,[ScanData.ID_NUMBER]))

Thanks again!



Ed Warren said:
I presume you mean to say the first letter of the first name and the first
five letters of the last name.

(works except for the case of Sam Smith and Sally Smith then they both are
ssmith)!!!

1. username: in a query put the following: lcase(userName:
left(1,[firstName] & left(5,[Lastname]))
2. password: password: lcase(left(1,[firstName])& left(1,lastName) &
right(4,cstr([id]))

Please note, the 'scheme' proposed violates all versions of the 'right' way
to build username/password pairs.

See the requirements for strong passwords at microsoft.com

Ed Warren.


Justin said:
I am trying to generate a username and password from data that I get from a
query. This information will be located in 2 columns - Username and
Password.
The username will contain the first letter of the first five letters of
the
last name. The password will contain the first letter of the first name
and
the first letter of the last name, followed by the last 4 digits of the ID
number. I am not sure how to create the expression for this, or if this
should be some sort of validation rule?

I appreciate any help you can provide!
 
Check your syntax on the user of LEFT and RIGHT. The string (or field)
comes first, followed by the number of characters you want returned.

For example,
Left([ScanData.FIRST_NAME],1)


Justin said:
Thanks for the response. The usernames will also include 4 digits from a
unique ID number to avoid duplicate usernames. I have this information
plugged in to a query, but I can't seem to get it to work. I get the
following error message:

"Data type mismatch in criteria expression"

I've gone back to the table that I am using this query from and all of the
data type fileds are set to text. Am I missing something? Here is the
coding
I am using for the query:

PASSWORD:

LCase(Left(1,[ScanData.FIRST_NAME]) & Left(1,[ScanData.LAST_NAME]) &
Right(4,[ScanData.SOCIAL_SEC_NUMBER]))

USERNAME:

lcase(Left(1,[ScanData.FIRST_NAME] & left(5,[ScanData.LAST_NAME])) &
Right(4,[ScanData.ID_NUMBER]))

Thanks again!



Ed Warren said:
I presume you mean to say the first letter of the first name and the
first
five letters of the last name.

(works except for the case of Sam Smith and Sally Smith then they both
are
ssmith)!!!

1. username: in a query put the following: lcase(userName:
left(1,[firstName] & left(5,[Lastname]))
2. password: password: lcase(left(1,[firstName])& left(1,lastName) &
right(4,cstr([id]))

Please note, the 'scheme' proposed violates all versions of the 'right'
way
to build username/password pairs.

See the requirements for strong passwords at microsoft.com

Ed Warren.


Justin said:
I am trying to generate a username and password from data that I get
from a
query. This information will be located in 2 columns - Username and
Password.
The username will contain the first letter of the first five letters of
the
last name. The password will contain the first letter of the first name
and
the first letter of the last name, followed by the last 4 digits of the
ID
number. I am not sure how to create the expression for this, or if this
should be some sort of validation rule?

I appreciate any help you can provide!
 
Hi John,

Thanks for the info. That took care of the error message, however, when I
run the query, it does not pull any information.

John Spencer said:
Check your syntax on the user of LEFT and RIGHT. The string (or field)
comes first, followed by the number of characters you want returned.

For example,
Left([ScanData.FIRST_NAME],1)


Justin said:
Thanks for the response. The usernames will also include 4 digits from a
unique ID number to avoid duplicate usernames. I have this information
plugged in to a query, but I can't seem to get it to work. I get the
following error message:

"Data type mismatch in criteria expression"

I've gone back to the table that I am using this query from and all of the
data type fileds are set to text. Am I missing something? Here is the
coding
I am using for the query:

PASSWORD:

LCase(Left(1,[ScanData.FIRST_NAME]) & Left(1,[ScanData.LAST_NAME]) &
Right(4,[ScanData.SOCIAL_SEC_NUMBER]))

USERNAME:

lcase(Left(1,[ScanData.FIRST_NAME] & left(5,[ScanData.LAST_NAME])) &
Right(4,[ScanData.ID_NUMBER]))

Thanks again!



Ed Warren said:
I presume you mean to say the first letter of the first name and the
first
five letters of the last name.

(works except for the case of Sam Smith and Sally Smith then they both
are
ssmith)!!!

1. username: in a query put the following: lcase(userName:
left(1,[firstName] & left(5,[Lastname]))
2. password: password: lcase(left(1,[firstName])& left(1,lastName) &
right(4,cstr([id]))

Please note, the 'scheme' proposed violates all versions of the 'right'
way
to build username/password pairs.

See the requirements for strong passwords at microsoft.com

Ed Warren.


I am trying to generate a username and password from data that I get
from a
query. This information will be located in 2 columns - Username and
Password.
The username will contain the first letter of the first five letters of
the
last name. The password will contain the first letter of the first name
and
the first letter of the last name, followed by the last 4 digits of the
ID
number. I am not sure how to create the expression for this, or if this
should be some sort of validation rule?

I appreciate any help you can provide!
 
Since you haven't posted a query, it is kind of hard to say why you aren't
getting in records. I don't even know if this query is a SELECT query, a
DELETE query, and UPDATE query, etc.

Please copy and post the SQL of your query.

(Possibly unneeded instructions follow)
Open the query
Select View:Sql from the Menu
Select all the text
Copy it
Paste it into the message

Then tell us what you expect to happen when you run the query.


Justin said:
Hi John,

Thanks for the info. That took care of the error message, however, when I
run the query, it does not pull any information.

John Spencer said:
Check your syntax on the user of LEFT and RIGHT. The string (or field)
comes first, followed by the number of characters you want returned.

For example,
Left([ScanData.FIRST_NAME],1)


Justin said:
Thanks for the response. The usernames will also include 4 digits from
a
unique ID number to avoid duplicate usernames. I have this information
plugged in to a query, but I can't seem to get it to work. I get the
following error message:

"Data type mismatch in criteria expression"

I've gone back to the table that I am using this query from and all of
the
data type fileds are set to text. Am I missing something? Here is the
coding
I am using for the query:

PASSWORD:

LCase(Left(1,[ScanData.FIRST_NAME]) & Left(1,[ScanData.LAST_NAME]) &
Right(4,[ScanData.SOCIAL_SEC_NUMBER]))

USERNAME:

lcase(Left(1,[ScanData.FIRST_NAME] & left(5,[ScanData.LAST_NAME])) &
Right(4,[ScanData.ID_NUMBER]))

Thanks again!



:

I presume you mean to say the first letter of the first name and the
first
five letters of the last name.

(works except for the case of Sam Smith and Sally Smith then they
both
are
ssmith)!!!

1. username: in a query put the following: lcase(userName:
left(1,[firstName] & left(5,[Lastname]))
2. password: password: lcase(left(1,[firstName])& left(1,lastName) &
right(4,cstr([id]))

Please note, the 'scheme' proposed violates all versions of the
'right'
way
to build username/password pairs.

See the requirements for strong passwords at microsoft.com

Ed Warren.


I am trying to generate a username and password from data that I get
from a
query. This information will be located in 2 columns - Username and
Password.
The username will contain the first letter of the first five letters
of
the
last name. The password will contain the first letter of the first
name
and
the first letter of the last name, followed by the last 4 digits of
the
ID
number. I am not sure how to create the expression for this, or if
this
should be some sort of validation rule?

I appreciate any help you can provide!
 
Back
Top