Ok I have about roughly 100 users. All have a designated sign on Alias so I am restricting them from being able to change that using VB. Now I have gotten to the point where I want them to set their passwords. I’ve looked in the help files to no avail. The books I am using are no help. Anyway I want the user to set their password and when they do I want the Login table in my Access database to be updated with their password. The Login table contains their Alias already, but since I haven’t distributed this yet, no passwords are there. I have it set so they click a new password button and the new password dialog box pops up. If possible I also want them to enter it twice for validation purposes. Any help would be appreciated.
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
VBScript – Setting New User Password (MSVisual Studio 6.0, Access 2K)
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » VBScript – Setting New User Password (MSVisual Studio 6.0, Access 2K)
- This topic has 16 replies, 5 voices, and was last updated 23 years, 10 months ago.
Viewing 2 reply threadsAuthorReplies-
WSKevin
AskWoody Lounger -
WSNight
AskWoody Lounger
-
-
WSShane Sargent
AskWoody LoungerJuly 18, 2001 at 3:22 pm #533574If you would like them to be able to update their password in an Access db, and then validate that password in the future, it sounds like you’ll need to write an ASP page that will use ADO to get at the Access db. As far as a confirmation of the user’s password when they change it, you can use VBScript or JaveScript to compare the entries in the 2 text boxes prior to submitting the data to the ASP page.
Are you familiar with ASP pages and ADO?
-
WSNight
AskWoody LoungerJuly 18, 2001 at 4:28 pm #533586I know next to nothing about ASP, and very little about ADO. I’m realatively new at most of this. I just started learning VB, but because I have programming experience behind me in other languages it wasn’t hard to learn.
As I said though all I need them to do is set their password in the VB application then have that password be saved to a table in access. When they log in later I will have a text bax that access that table and looks for the password in the table (basically a .find command) and when it finds it the code will also see if what you types matches the alias in the user name box and if all works well then you can access the information you want. Hope this helps clarify better what I want to do. thanks for any help.
-
WSKevin
AskWoody LoungerJuly 18, 2001 at 5:51 pm #533607I’d sure like to offer a solution, but it seems so simple that I risk insulting your intelligence. So, I hesitate as I might be totally misunderstanding the issue.
If you are managing the entire operation: prompt for name and password, check against table for valid match (username corresponds with password for that table row), allow user in; and if you want to now prompt to allow the user to change password: prompt displays username and two empty text boxes 1) Enter Password, 2) Enter Password again., compare passwords, if match, store in table row for user.
Is that it? Are you hashing or in any way encrypting the password? That doesn’t seem to be a problem. I’m missing something, right?
-
WSNight
AskWoody LoungerJuly 18, 2001 at 6:28 pm #533624Well you got most of it. I know pretty much how to do what you’ve said. The problem that I will be having is that the table that is holding the username and password, won’t have any information in the table until the person registers. When first signing on to the application they have to hit the “New User” button. That will prompt them to enter a user name and then their password. What I want this to do is when they hit the ok button, I want the user name and password to be stored in that table. Does that make more sense? Maybe I wasn’t clear. Sorry if I wasn’t, I really do appreciate the help.
-
WSJerryC
AskWoody Lounger -
WSKevin
AskWoody LoungerJuly 18, 2001 at 8:14 pm #533637Maybe Charlotte or someone more familiar with Access
syntax can show you some code. If this were a SQL
environment using ADO the code to validate a user would
look like this:strQry = “select table.username, table.password
where table.username = strUsername AND
table.password = strPassword”rs.Open strQry, cn, 3, 1, 1
(assumes connection and record source objects already
created)if rs.RecordCount 0 then
‘Let this person in.
else
‘Lock this person out
endifTo add a new user:
strQry = “Insert table(username, password)
values(strusername, strpassword)”To update a changed password:
strQry = “Update table
Set password = strNewPassword
Where username = strUsername”I realize this does you absolutely no good, but maybe it will
help an Access person grasp what you want. -
WSNight
AskWoody Lounger -
WSKevin
AskWoody Lounger -
WScharlotte
AskWoody LoungerJuly 18, 2001 at 9:46 pm #533662That’s pretty close to what I’d use in Access or VB too, although I prefer to replace numeric arguments with local constants where necessary so I can remember what the heck I was passing in. Of course, you don’t use a record count when you execute an action query in ADO, you pass in a long variable to the RecordsAffected argument and let the value in that variable tell you how many records it actually updated.
-
WSKevin
AskWoody Lounger -
WScharlotte
AskWoody Lounger -
WSNight
AskWoody LoungerJuly 19, 2001 at 12:39 pm #533752I’ll try that out to see how it works. Thanks for your help. I assume that it is generally the same kind of thing for the user name as well. As for the security with the table holding the passwords. The database itself will not be accessed by anyone except the admin, they will also have restricted permissions as well. Anyway thanks for your help.
-
-
-
WSShane Sargent
AskWoody Lounger
-
-
-
WScharlotte
AskWoody LoungerJuly 18, 2001 at 10:16 pm #533666Here are the basic steps I think you want to take, keeping in mind that storing a password in a database is not true security:
1. Get the user to input a username and verify that as a valid user.
2. Get the user to enter a password and verify that the password belongs to the validated user.
If either of the above is invalid, return an “invalid name or password” message but don’t tell them which one is incorrect if you want to make it harder to crack.
3. For a change password, you need to have a conditional branch. Look up the username to see if they have a password. If they do, require them to enter the old password and then to enter a new password twice to validate it. If they don’t have a password, just have them enter a new password twice. In either case store the new password to a variable temporarily.
4. Once you have a valid username and password, run an action query to update the username record to have the new password.
Here’s one of my ADO funtions to execute an action query:
Public Function ExecuteActionQuery(Optional strQryName As String, _ Optional strSQL As String) 'created by Charlotte Foust 'last modified 7/18/2001 'executes and action query either from a SQL string 'or from a saved query On Error GoTo Proc_err Dim cmd As ADODB.Command Dim prm As ADODB.Parameter Dim errCurr As ADODB.Error Dim lngRecsAffected As Long Const ERR_OPER_ON_INVALID_CONNECTION = 3709 Const ERR_BOF_EOF_OR_DELETED = -2147352567 'initialize the command object Set cmd = New ADODB.Command 'set its active connection to the current project's connection cmd.ActiveConnection = CurrentProject.Connection 'if a SQL string was passed, use that If strSQL "" Then cmd.CommandType = adCmdText cmd.CommandText = strSQL cmd.Execute RecordsAffected:=lngRecsAffected, Options:=adCmdText 'else if a query name was passed, 'execute that query ElseIf strQryName "" Then cmd.CommandType = adCmdStoredProc cmd.CommandText = strQryName cmd.Execute RecordsAffected:=lngRecsAffected, Options:=adCmdStoredProc Else 'strSQL "" ' No valid argument was passed End If 'strSQL "" Proc_exit: 'cleanup and exit On Error Resume Next Set cmd = Nothing 'return the number of affected records ExecuteActionQuery = lngRecsAffected Exit Function Proc_err: If cmd.ActiveConnection.Errors.Count > 0 Then For Each errCurr In cmd.ActiveConnection.Errors MsgBox errCurr.Number & "--" & errCurr.Description Resume Proc_exit Next errCurr ElseIf Err.Number = ERR_BOF_EOF_OR_DELETED Then Resume Next Else MsgBox Err.Number & "--" & Err.Description ExecuteActionQuery = Err Resume Proc_exit End If End Function 'ExecuteActionQuery(Optional strQryName As String, _ Optional strSQL As String)
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
1 hour, 43 minutes ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
3 hours, 9 minutes ago -
What is wrong with simple approach?
by
WSSpoke36
4 hours, 45 minutes ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
11 hours, 13 minutes ago -
Location, location, location
by
Susan Bradley
29 minutes ago -
Cannot get a task to run a restore point
by
CWBillow
12 hours, 39 minutes ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
3 hours, 23 minutes ago -
June 2025 Office non-Security Updates
by
PKCano
23 hours, 24 minutes ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
5 hours, 28 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
23 hours, 20 minutes ago -
How start headers and page numbers on page 3?
by
Davidhs
1 day, 9 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
12 hours, 26 minutes ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
1 day, 18 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
1 day, 18 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
1 day, 8 hours ago -
Firefox 139
by
Charlie
1 day ago -
Who knows what?
by
Will Fastie
3 hours, 6 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
1 day, 19 hours ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
1 day, 13 hours ago -
Misbehaving devices
by
Susan Bradley
14 hours, 53 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
3 days, 1 hour ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
1 hour, 2 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
2 days, 23 hours ago -
Discover the Best AI Tools for Everything
by
Alex5723
1 day, 22 hours ago -
Edge Seems To Be Gaining Weight
by
bbearren
2 days, 13 hours ago -
Rufus is available from the MSFT Store
by
PL1
2 days, 22 hours ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
4 days ago -
KB5061768 update for Intel vPro processor
by
drmark
2 days ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
1 day, 23 hours ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
3 days, 20 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.