Password Validation
Jul 18, 2006
Came across this and modified it so that it checks if the password entered has at least one number or symbol.
(a function to be placed in a global module not macro)
Code:Function IsAlphaNumeric(strTest) As Boolean'IsAlphaNumeric used to test if a string has a number or a symbol in addition to regular alpha characters.'What it does it take an input string and converts each character of the string into its corresponding ASCII code (uses the VBA function Asc()).'The function then checks the ASCII value of each character and adds one to count if the character was a number or symbol.'The function also checks the ASCII value of each character and adds one to count2 if the character was a regular alpha character.'Finally the function checks to see if count and count2 are both greater then 0, if it is then the string has a number or a symbol in addition to regular alpha characters.Dim Char As StringDim CharNum As IntegerDim i As IntegerDim count As IntegerDim count2 As Integercount = 0count2 = 0 For i = 1 To Len(strTest) Char = Mid(strTest, i, 1) CharNum = Asc(Char) '48-57 is the ASCII range for 1-0, the other values are for the following symbols ~ ! @ # $ % ^ & * ( ) ` If (CharNum > 47 And CharNum < 58) Or (CharNum = 33) Or _ (CharNum > 34 And CharNum < 39) Or (CharNum > 39 And CharNum < 43) Or _ (CharNum = 64) Or (CharNum = 94) Or (CharNum = 96) Or (CharNum = 126) Then count = count + 1 End If '65-90 is the ASCII range for A-Z, 97-122 is the ASCII range for a-z If (CharNum > 64 And CharNum < 91) Or (CharNum > 96 And CharNum < 123) Then count2 = count2 + 1 End If Next i If count > 0 And count2 > 0 Then IsAlphaNumeric = True Else IsAlphaNumeric = False End If End Function
I use it when the user wants to change the password for the local front end db. It makes sure that the user has to have a password at least six characters in length and must have a symbol or letter.
Code: If newpass = Me.currpw.value Then MsgBox "Password cannot be updated. Please make sure the new password is different from the original password", vbExclamation, "Password update FAILED!" Exit Sub End If If Not newpass = Me.confrimpw.value Then MsgBox "Password cannot be updated. Passwords do not match, please make sure to re-enter the new password twice.", vbExclamation, "Password update FAILED!" Exit Sub End If If Len(newpass) > 6 And IsAlphaNumeric(newpass) Then 'Update current user's password DoCmd.RunSQL ("UPDATE Users SET [strEmpPassword] = '" & newpass & "' WHERE [lngEmpID] = lngMyEmpID;") MsgBox "Password has been updated ", vbInformation, "Password updated!"
With this you can expand it so that if you want the user’s new password to have at least one number and one symbol
One thing I am not sure about is to make sure the password is a strong password and not a weak one. I was thinking of having it subtract the ASCII code of every two characters and if there value is 2 or less add one to a general count variable, then divide that general count variable by the number of iterations and check to see if that value is 2 or less if so then it’s a weak password, not sure if that makes sense, any ideas?
View Replies
ADVERTISEMENT
Jan 6, 2014
I am looking to ensure the user enters a complex password, in the add user form. Therefore, the password should be >8 characters, 2 numbers, 1 Ucase min, 1 Lcase min and some form of punctuation. I found this code:
unction ValidatePassword(ByVal pwd As String,
Optional ByVal minLength As Integer = 8,
Optional ByVal numUpper As Integer = 2,
Optional ByVal numLower As Integer = 2,
Optional ByVal numNumbers As Integer = 2,
Optional ByVal numSpecial As Integer = 2) As Boolean
[Code] ....
but obviously this doesn't work in access. How can i either change it to work for microsoft access, or how would i go about developing it. What would the code be?
View 5 Replies
View Related
Sep 24, 2013
How to validate a MS Access password text box as criterion below?
(i) At least one uppercase
(ii) At least one lowercase
(iii) At least one number
(iv) Password length 8 - 12
View 1 Replies
View Related
Jan 6, 2014
I am looking at the public function routine, that validates the password entry. I want to know how i can make a message pop up with the specific error the user has made on entry.
Public Function ValidatePwd(varPassword As Variant) As Boolean
Dim blnValid As Boolean
Dim blnValidCriteria As Boolean
Dim intChar As Integer
blnValid = Len("" & varPassword) >= 4 And Len("" & varPassword) <= 12
[Code] ....
View 11 Replies
View Related
Mar 29, 2007
I have recently split my database and added a password to the back end. I am now trying to re-link the tables as I have seen in other threads, but when I do this I am not prompted for the password I just get the message 'Not a valid password'
I must obviously be doing something wrong, can anyone help?
View 4 Replies
View Related
Nov 8, 2005
Hi,
Firstly thank you for your help, this should be a simple one I hope, but is cracking my head on the wall. Have searched and searched and can't find an answer.
I have an Access Db that is not password protected, but is asking for a password.
It opens on any other machine fine?
I think my version of Access is playing funny buggers with me, any suggestions?
I was trying to implement some security on this Db, which is why it happened I'm sure. I ran the security wizard, set-up two users and admin with passwords, I have the output file to "recreate" something too.
Issue is, I then copied this Db to another computer for use on there, it worked without a Password, so didn't need to worry about it, now I can't open any Db on my machine??
Your help on this obvious pointer would be great!
C
View 3 Replies
View Related
Sep 12, 2006
hi pals
i have set username and password for ms access file.
unfortunately i have forget that password?
how to crack that username and passowrd?
is there any softwares available?
i can easily crack the database pasword? but how to crack username and password of ms access file.
View 1 Replies
View Related
Oct 24, 2014
i have found a code that brings up a box when tab or clicking in to a box for editing as below:-
Dim strPassword As String
If InputBox("Please enter the password:") <> strPassword Then
SomeOtherControl.SetFocus
TextBox1.Locked = True
End If
its just that need to add a password as well, i have tried to put this in between the <> but this does not work. i would like a message to say incorrect password as well if possable.
View 4 Replies
View Related
Aug 19, 2005
Hi all
Firsty i am a novice to Databases so i only really know the basics, heres my problem.
I have a database at work that i need to password protect, but i want it so when people open it up, it gives them the option of viewing it in read only mode, but if they have the password then they can use it properly and edit things, is this possible? and if so is it easy??
Thanks everyone
Chris
View 1 Replies
View Related
Sep 1, 2005
Ok I want to do auto backup using the auto compact db, I think I got from here., anyways I want to copy it but the auto compact cant because of the DB password is there a way around this like have the password in the path of the db?
View 2 Replies
View Related
Jan 17, 2006
Hya.
In my database I've two diferents forms but I want one of them to be accessed only for few users where they have to type username and passaword.
Is anyone there could tell me how can I do that please?
Thanks
View 1 Replies
View Related
Jan 25, 2007
I don't realy know how to explain this but a college of mine has done something to her Access settings, whenever she tries to open a database it asks her for a User login password.
The prompt is a box with
Name: Centre Manager
Password:
If she types Centre Manager in the password box then it lets her in as normal. Everyone else can just access the databases without being prompted for a password.
Does anyone know what she has done?
View 2 Replies
View Related
Apr 23, 2007
A password to one of my MDB files has been changed for some reason and I need to get access to it. Does anyone know of a freeware program that I can get to gain access to it? Your help is appreciated.
View 2 Replies
View Related
May 12, 2005
I would like to set a database password for my back end so that ppl could not "exidentaly" open the wrong .mdb file. Then i want to send a database password from my front end to my back end so that users who use FE would login my BE automaticaly? Is this posible? If so, how?
One more question. Is it posible to based on a login name(form in FE) open a BE readonly or normaly?
Thx
View 1 Replies
View Related
May 18, 2005
I created a workgroup account with a password. I joined this work group and all has been well until my harddrive died. I have the work group and I have the password but I can't remember to user name. Is there anyway to open the work group to get the user name?
Jon
View 1 Replies
View Related
Jun 23, 2005
I'm creating a data access page that can be used over the internet to add information into the database. The database is password protected. The functionality currently is that when a user accesses the data access page, they need the database password in order to submit information. We don't have a small number of users and giving all these people the password to the database would comprimise the security of the system.
I am looking for a functionality such that the people that edit the database, either by the front end application or by opening the database directly to be password protected. But the data access page not to be.
Any ideas on how I can achieve this functionality?
View 8 Replies
View Related
Aug 3, 2005
Hi:
i have a MS Access aplication that have a vba code with a password.
Now i have a patch (in MS Access too) that will upload this full aplication, but when i try to copy a form didnt work. This is because have password in the vbe code.
someone knows how can i unlock the vbe before update the form and after update the from lock in VBA language?
thanks
View 1 Replies
View Related
Dec 14, 2005
Hi. In my database it opens up in switchboard mode. Is it possible to create a password within a switchboard?
I also different levels depending on which switchboard item they choose.
e.g. if they click "student" rather than "teacher"
How do I acheive this?
Thanks!
View 2 Replies
View Related
Dec 16, 2005
I have successfully created a user id & password prompt which works excellently.
The database i have created has three forms inwhich two departments access. I have an issue where one department is only allowed to view a search screen and the other department is allowed to enter in information and search. I also have a section for managers to login and run reports.
In my userid & password table i have created and field called Level which includes: Administrator, Manager, Bookings,User
Admin - Full Access
Managers - Full Access - But not able to edit queries and tables
Bookings - Order Form, Search Form
User - Search Form
Here is the code i have used:
Login OK Button:-
Private Sub login_Click()
If txtPassword.Value = DLookup("Password", "tblAccess", "[UserId] = txtUser.Value") Then
CheckFlag
DoCmd.Close acForm, "frmUserLogon"
Else
MsgBox "INCORRECT PASSWORD! Please try again"
End If
End Sub
Module1:
Option Compare Database
Public Flag As Integer '1: Reports Opener 2:Log 3:OpenUKSupplier
Function CheckFlag()
Select Case Flag
Case 1
DoCmd.OpenForm "frmReports Menu"
Case 2
DoCmd.OpenForm "frmbooking"
Case 3
DoCmd.OpenForm "Frmsearch"
Case Else
'Should never be here
End Select
End Function
Where would i add the code to the module or to the event?
View 4 Replies
View Related
Apr 10, 2006
Hi,
I have secured my db with password. I want to know the technique/technology so that i can read my password. Access must be storing the password in an encrypted form in any password file. My idea is that if I know the file where its stored and in what form then I hope it can be retrieved.
I find so many available sites who claims that they have their product which is able to retrieve access db passowrd. I want to learn on how to do the same.
Any idea or suggestions is highly appreciated.
Thanks.
View 2 Replies
View Related
Apr 12, 2006
HI ALL,
I have been working on some database protection techniques and have found floors in all of them.
Basically I have to protect a database not using the application password... which has a different password for each form. This means using form passwords ect... but all of them can be hacked by using the shift key on start-up does anyone know how to get around this as im stuck and could really do with another’s perspective.
Thanks in advance.
View 2 Replies
View Related
May 8, 2007
Every time I open up access I get a logon box which asks for the admin password. This applies to any database project I open. I for the life of me can't figure out how it was turned on, but it still has the generic password associated with it(thank god).
I am trying to rid myself of having to type it in every single time I open up a database project. I have tried to delete it in the security section of tools and it won't allow me to delete the admin.
This is incredibly annoying because neither of the database projects requires a password, and I am not even the one that created the projects. I am merely a user.
Any suggestions on how to rid myself of this annoying problem?
View 1 Replies
View Related
Jul 27, 2007
hello,
I have a password textbox on a form. As the user types in his password I want the textbox to display the '*' symbol, just like on any log in page. How do I do this?
thanks
View 3 Replies
View Related
Aug 1, 2007
I have set a password on my access document but now need to change it - does anyone know how to do this?
View 1 Replies
View Related
Aug 29, 2007
Hi,
I'm using Access 97. I have an Access application that consists of two databases, a front end witht he usual forms, reports, queries etc. and a back end with the data.
I use my own simple logon form to restrict access at the front end, but nothing on the back end.
I really want to restrict access to the back end by placing a password on the database.
How do I still allow people who use the front end to get into the system and access the data, yet prevent them from accessing the back end directly?
I have put the password on the back end easily enough, but when I try to use the front end I just get the message, 'Invalid Password'.
Regards,
Bernard D
View 6 Replies
View Related
Nov 13, 2007
Hi all,
I have created a database and rather than use a FE/BE for different users there is only myself who modifies and another set of users who run reports) I have set it up with a switchboard for me :) and a form I have designed for the reports. Now the way I have worked it is that I have an admin password for me and a user password for the others with their access restricted to the form I want them to see.
This works great on my pc and I have setup a shortcut to the form for the others to click into for ease of use. Using my PC this works spot on, but when I go on any other pc on the network they do not have to log on at all and just go straight into the DB with full access to everything.
Any ideas on how I can sort this?
(other than go around every pc in the place and put passwords on :()
Thanks in advance :)
View 1 Replies
View Related