473,480 Members | 4,985 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Whats the easiest way to allow a user to change password in an A97 app?

MLH
What's the simplest way to allow a user
of an A97 app to change password?
Nov 13 '05 #1
2 2386
"MLH" <CR**@NorthState.net> wrote in message
news:vh********************************@4ax.com...
What's the simplest way to allow a user
of an A97 app to change password?


Their own Access user-level security password? Simplest for you or the
user? The simplest for you might be to let them use the built-in tools (the
workgroup administrator) and show them the change logon password tab.
However it wouldn't be too much work to create a popup form specifically to
change their own passwords - have 3 textboxes txtOldPassword,
txtNewPassword, txtConfirmPassword with a buttons OK and Cancel. The OK
button calls a function like below:

Private Function ChangePassword(strOld As String, _
strNew As String, _
strVerify As String) As Boolean

On Error GoTo Err_Handler

Dim wks As DAO.Workspace

If strNew <> strVerify Then
MsgBox "Your new password and the verification of your " & _
"new password do not match." & vbCrLf & _
"Please try again.", vbExclamation, "Cannot change password"
Exit Function
End If

If strNew = strOld Then
MsgBox "Your new password is the same as your old password" & vbCrLf
& _
"Please try again.", vbExclamation, "Cannot change password"
Exit Function
End If

Set wks = DBEngine(0)

wks.Users(CurrentUser).NewPassword strOld, strNew

ChangePassword = True

Exit_Handler:
If Not wks Is Nothing Then Set wks = Nothing
Exit Function

Err_Handler:

Select Case Err.Number

Case 3033
MsgBox "Old password is not correct" & vbCrLf & _
"Please try again." & vbCrLf & vbCrLf & _
"(remember passwords are case sensitive)", vbExclamation,
"Cannot change password"
Case Else
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number

End Select

Resume Exit_Handler

End Function
Nov 13 '05 #2
MLH
Thx, Justin... this was just the code I needed!
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Their own Access user-level security password? Simplest for you or the
user? The simplest for you might be to let them use the built-in tools (the
workgroup administrator) and show them the change logon password tab.
However it wouldn't be too much work to create a popup form specifically to
change their own passwords - have 3 textboxes txtOldPassword,
txtNewPassword, txtConfirmPassword with a buttons OK and Cancel. The OK
button calls a function like below:

Private Function ChangePassword(strOld As String, _
strNew As String, _
strVerify As String) As Boolean

On Error GoTo Err_Handler

Dim wks As DAO.Workspace

If strNew <> strVerify Then
MsgBox "Your new password and the verification of your " & _
"new password do not match." & vbCrLf & _
"Please try again.", vbExclamation, "Cannot change password"
Exit Function
End If

If strNew = strOld Then
MsgBox "Your new password is the same as your old password" & vbCrLf
& _
"Please try again.", vbExclamation, "Cannot change password"
Exit Function
End If

Set wks = DBEngine(0)

wks.Users(CurrentUser).NewPassword strOld, strNew

ChangePassword = True

Exit_Handler:
If Not wks Is Nothing Then Set wks = Nothing
Exit Function

Err_Handler:

Select Case Err.Number

Case 3033
MsgBox "Old password is not correct" & vbCrLf & _
"Please try again." & vbCrLf & vbCrLf & _
"(remember passwords are case sensitive)", vbExclamation,
"Cannot change password"
Case Else
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number

End Select

Resume Exit_Handler

End Function


Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1627
by: edd | last post by:
Ive seen a few examples of how to password protect my pages by either textfiles / access. But how can I make the pages so that no one can just enter the url and bypass the login page. Im trying...
1
2012
by: mike | last post by:
Hello all, any advice or links to pages about how to have multiple language asp pages? For example, you have a database driven website that you want customers around the world to use. How do...
5
1972
by: Alexandre Martins | last post by:
Provider=Microsoft.Jet.OLEDB.4.0;UserId=Admin;Password=teste;Data Source=C:\Inetpub\wwwroot\inktoner\dados\db_inktoner.mdb;Persist Security Info=True I can't connect in my database ! whats...
2
2273
by: Rod | last post by:
I have a requirement in which I need to allow the user to log into our ASP.NET application, but also be able to change their Windows password, if it is expired. I had thought that Windows...
6
2341
by: Anita | last post by:
I have problem opening my existing projects or newly created project. It asks me for user name and password and if I provide then it allows me to open but when I debug either it gives error message...
20
2411
by: Snis Pilbor | last post by:
Whats the point of making functions which take arguments of a form like "const char *x"? It appears that this has no effect on the function actually working and doing its job, ie, if the function...
2
1917
by: Nosferatum | last post by:
This script is meant to limit access by sessions, using username and password from mysql db and redirect users after login according to a given value belonging to each user in the db (10,20,30,40)....
0
1102
by: dengel | last post by:
I'm a classic ASP/VbScript user, transitioning to c# and .NET. I'm making a little PW change utility which does this: 1. User inputs an email address/username (into a textbox) 2. User inputs...
2
2334
by: Mel | last post by:
We have a private website, we call it a portal, where people can login and get quotes and such. When you go to the portal URL (https:// example.url.com) a small dialog appears (I believe this is...
0
7040
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
7080
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...
0
6908
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2994
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.