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.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
-
Does windows update component store “self heal”?
by
Mike Cross
1 hour, 9 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
2 hours, 10 minutes ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
1 hour, 35 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
2 hours, 16 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
4 hours, 51 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
4 hours, 53 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
11 hours, 54 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
13 hours ago -
0Patch, where to begin
by
cassel23
7 hours, 2 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
1 day, 2 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
14 hours, 24 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
1 day, 11 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 day, 2 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
13 hours, 17 minutes ago -
Installer program can’t read my registry
by
Peobody
8 hours, 15 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
23 hours, 57 minutes ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 7 hours ago -
False error message from eMClient
by
WSSebastian42
1 day, 22 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 days, 7 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
2 days, 8 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
1 day, 5 hours ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
2 days, 12 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
1 day, 13 hours ago -
Outdated Laptop
by
jdamkeene
2 days, 17 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
2 days, 22 hours ago -
Another big Microsoft layoff
by
Charlie
2 days, 22 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
46 minutes ago -
May 2025 updates are out
by
Susan Bradley
2 hours, 28 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
3 days, 4 hours ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
3 days, 4 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.