473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Masking Passwords

When trying to create a login page in access I am having trouble concealing the password. I have the table setup to accept password as text and masked as "*". In the form I have played around with having the password box show data in real characters or "*". It only works when I have the password box set to text, it provides me with errors if I have the textbox masked to "*"

Any hints?

Thanks
Mar 9 '07 #1
12 4191
Rabbit
12,516 Expert Mod 8TB
Set the Textbox's Input Mask Property to PASSWORD
Mar 9 '07 #2
Thanks. Unfortunately doing this leads me to the errors I mentioned before. I am also having trouble with my query code, access says it cannot execute my query. Here is my code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command6_Click()
  2.  
  3.     Dim usr As String
  4.     txtUsername.SetFocus
  5.     usr = txtUsername.Text
  6.  
  7.     Dim pass As String
  8.     txtPassword.SetFocus
  9.     pass = txtPassword.Text
  10.  
  11.     Dim strSQL As String
  12.     strSQL = "SELECT Username, Password FROM LoginInfo WHERE ((LoginInfo.Username = '" & usr & "') AND (LoginInfo.Password = '" & pass & "'))"
  13.  
  14.     Dim dbs As DAO.Database
  15.     Dim qdf As DAO.QueryDef
  16.  
  17.     Set dbs = CurrentDb
  18.  
  19.     dbs.QueryDefs.Delete ("Login")
  20.     Set qdf = dbs.CreateQueryDef("Login", strSQL)
  21.     dbs.Execute ("Login")
  22.     dbs.QueryDefs.Delete ("Login")
  23.  
  24.     If (qdf.OpenRecordset.EOF) Then
  25.         MsgBox ("Username and/or password is incorrect.")
  26.     Else
  27.         'Close an Inventory Form
  28.         DoCmd.Close acForm, "LoginView", acSaveYes
  29.  
  30.         'Open an Employee Form in Edit Mode
  31.         DoCmd.OpenForm "Main Menu", acNormal, , , acFormEdit, acWindowNormal
  32.     End If
  33.  
  34.     dbs.QueryDefs.Delete ("Login")
  35.  
  36. On Error GoTo Err_cmdExitForm_Click
  37.  
  38. Exit_cmdExitForm_Click:
  39.     Exit Sub
  40.  
  41. Err_cmdExitForm_Click:
  42.     MsgBox Err.Description, vbExclamation, "Error in LoginView_Close()"
  43.     Resume Exit_cmdExitForm_Click
  44. End Sub
Mar 9 '07 #3
NeoPa
32,556 Expert Mod 16PB
Please try to keep the thread on track.
If this is a new, unrelated question, then it needs to be in its own thread.
You will also need to rephrase it of course, as this is not a simple bug-fixing service. We are happy to answer specific questions, or to help where possible, but simply dumping a page of code to be 'fixed' is not the idea.

Where are you with the password issue?
What exactly is the problem you find when using 'PASSWORD' as the Input Mask?
Mar 10 '07 #4
I'm sorry about my poor posting earlier, I didn't mean to form my question that way. When I switch the input mask to Password, I get my self programed error check, a message box popping up saying "invalid username/password"

Thanks
Mar 15 '07 #5
Denburt
1,356 Expert 1GB
Remove your error message and tell us what the MS Access error is.

msgbox err.number & " " & err.description
Mar 15 '07 #6
Denburt
1,356 Expert 1GB
Excuse my previous hasty post, always bsy.

O.K. I reviewed you code from above and it needs a LOT of clean up.

First whenever reffering to a control on a form you are currently in then you should always refer to it by using me!

Such as: Me!txtPassword.SetFocus

That will save you a lot of headaches.
Next use the following:

pass = Me!txtPassword

instead of

pass = Me!txtPassword.text

That will give your variable the actual password and not just the mask.


Next problem, you have the following:

Expand|Select|Wrap|Line Numbers
  1.   Set dbs = CurrentDb
  2.  
  3.     dbs.QueryDefs.Delete ("Login")
  4.     Set qdf = dbs.CreateQueryDef("Login", strSQL)
  5.     dbs.Execute ("Login")
  6.     dbs.QueryDefs.Delete ("Login")
change it to read

Expand|Select|Wrap|Line Numbers
  1.  Set dbs = CurrentDb
  2.  Set qdf = dbs.CreateQueryDef("Login", strSQL)
Make sure the login query is deleted before you run this and you should be fine.

Tried and tested good luck.
Mar 15 '07 #7
The error doesn't come up unless I put up the message. It i just a ZERO or capital "O" not quite sure.

Thanks
Mar 15 '07 #8
NeoPa
32,556 Expert Mod 16PB
I'm not sure what you're trying to say here :o
Mar 16 '07 #9
It works!!!!! THANK YOU SO VERY MUCH!!!!!!!!!!!! :)
Mar 16 '07 #10
NeoPa
32,556 Expert Mod 16PB
:)
I'm not sure what changed so much in the mean time, but it's always nice to 'hear' a happy response.
One for denburt I think.
Mar 16 '07 #11
Denburt
1,356 Expert 1GB
Thanks, WTG glad it is working! :)
Mar 16 '07 #12
NeoPa
32,556 Expert Mod 16PB
By the way.
I'm creating a new thread for this discussion to avoid hijacking this one. Once it's properly sorted out I will delete the posts not relevant to each thread.
This thread should remain on topic from now then, and the other thread is Referencing Controls on a Form.
Mar 16 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Florian Lindner | last post by:
Hello, I've a scripts that allows limited manipulation of a database to users. This script of course needs to save a password for the database connection. The users, on the other hand need read...
14
by: Miranda | last post by:
Hi, I have a ASP/vbscript program that generates random passwords. The problem is I need to insert those passwords into an Access database of 327 clients. I have the random password program...
2
by: Ginchy | last post by:
I have uploaded a small 3 page web using MS Publisher 2003 and after uploading I switched on url masking to cloak the url. I am certain that it worked fine. I simply changed the colour scheme...
0
by: Dana Epp | last post by:
I have a ToolBarButton that when I set it to disabled (button.Enabled = false;) causes a really ugly gray masking effect to take place. This is normal and the intended way of the button, but I...
15
by: Dino Vliet | last post by:
Hi folks, probably this is a question you've heard so many times but I wasn't able to find a solution to it. I'm using a shell script to create a textfile for me. It looks like...
5
by: Macca | last post by:
Hi, My application uses passwords to limit access to certain parts of the app. I was considering storing these in my database but have heard that there can be problems with this. I have heard...
19
by: Cord-Heinrich Pahlmann | last post by:
Hi, I have written a tool wich de/encrypts a few of my forum and bloggin-Passwords. My question is how secure it is. The following describes how I have encrypted my passwords. When I log in,...
2
by: Simon.Whiteside | last post by:
If someone has created a database for me and transferred it over is there any way that I can check I have full access to all areas? I am a beginner with Access and so the development has been...
9
by: Daniel Smedegaard Buus | last post by:
Hey all :) I was wondering about the $error_types (I particularly notice the 's' suffix when reading the manual) parameter for 'set_error_handler()': Can be used to mask the triggering of the...
2
by: meghla | last post by:
I can not understand how to implement bit masking on a c code?? while working with array it is taking too much time.................. so i need help. i need some suggestion and sample code of C...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.