473,401 Members | 2,127 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,401 software developers and data experts.

how to update new password to existing table in a custom login form using macros or query?

Hi, i am currently working on a project which requires me to create a
form to allow the user to change their password.

I know there is a user-level security login which is easier and safer
but was told that i could and even must not use it. GOD KNOWS WHY

So i created a custom login form with userID and password which
validates with a table containing all the users and their passwords.

Then, i thought it would be easier to allow the user to change their
password as they like by creating another form called "frmUpdatePW".

frmUpdatePW consists of 4 textbox:

-UserID
-Old Password
-New Password
-Confirm Password

& a command button
-cmdChangePW

i can validate whether userID matches with old password, but am stuck
at how to ensure the new password is entered into the table containing
the userID and password.

Can i use an update query to do so? and if its possible, how would i go
about doin dat?
Becoz i am still a newbie with access, i was wonderin is there even a
simpler way to update new password to existing table using forms. Can i
do without any modules or codes?

Thanks alot..i realli appreciate ur help..

Jan 4 '06 #1
7 4340
The SQL for your UPDATE query would be:
UPDATE tblUsers SET tblUsers.Password='" & txtNewPassword & "' WHERE
tblUsers.UserID='" & txtUserID & "'";

Note that there are single quotes outside of the double quotes.

You COULD do this by binding frmUpdatePW to tblUsers and binding your
Confirm Password textbox to the Password field in tblUsers. However,
this is a poor way to accomplish this task.

I would stick a DoCmd.RunSQL with the above SQL statement in the Click
event of cmdChangePW.

Jan 4 '06 #2
"Nerrad" <Ye********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hi, i am currently working on a project which requires me to create a
form to allow the user to change their password.

I know there is a user-level security login which is easier and safer
but was told that i could and even must not use it. GOD KNOWS WHY

By whom? I'm willing to bet that it was a manager who *thinks* he knows
what he's talking about but doesn't. User-level security has a steep
learning curve and isn't unbreakable but is, IMO, infinitely better than a
'roll your own' solution.

Just my 2p worth :-)

Keith.
www.keithwilby.com
Jan 4 '06 #3
thanxs for that..but i encounter another problem

i have three tables containing the userIDs and passwords for three
different level of access/ permission for different users. And the
above SQL would not work as it has only one table to update.

As i stick a macro in the click event of cmdChangePW (to verify
authencity of UserID and password/ to check whether textbox of new PW
and confirm PW are the same), if i were to add in the DoCmd.RunSQL in
the macro, would it be a problem.

Thanks loads, man!

Jan 5 '06 #4
My Update query SQL looks like this and access is giving me problems by
saying there is a syntax error in the query expression. What is wrong?
Can anyone help me? Lotsa thanxs in advance!
UPDATE tblPasswordReceivi
SET tblPasswordReceivi.Password = '" & txtConfirmPW & "' WHERE
tblPasswordReceivi.UserID ='" & txtusername & "'";

OR

UPDATE tblPasswordPurchase
SET tblPasswordPurchase.Password & txtConfirmPW & "' WHERE
tblPasswordPurchase.UserID ='" & txtusername & "'";

OR

UPDATE tblPasswordMgmt
SET tblPasswordMgmt.Password & txtConfirmPW & "' WHERE
tblPasswordMgmt.UserID ='" & txtusername & "'";

Jan 5 '06 #5
You're missing quotes after Password in the last two. They should be:

UPDATE tblPasswordPurchase
SET tblPasswordPurchase.Password='" & txtConfirmPW & "' WHERE
tblPasswordPurchase.UserID ='" & txtusername & "'";

Also check for nulls in txtConfirmPW and txtusername.

Jan 5 '06 #6
thanxs once again for ur help, realli appreciate it..
however i got another problem..
Here's what i did..
i created a macro at the on-click event (macroChangePW);
i created conditions to check whether any of the textboxes were null;
i verified whether the userID is correct with the passwords in their
respective tables;
i created three different actions, running the 3 SQLs respectively

1)
UPDATE tblPasswordReceivi
SET tblPasswordReceivi.Password = '" & txtConfirmPW & "' WHERE
tblPasswordReceivi.UserID ='" & txtusername & "'";

2)
UPDATE tblPasswordPurchase
SET tblPasswordPurchase.Password='" & txtConfirmPW & "' WHERE
tblPasswordPurchase.UserID ='" & txtusername & "'";

3)
UPDATE tblPasswordMgmt
SET tblPasswordMgmt.Password='" & txtConfirmPW & "' WHERE
tblPasswordMgmt.UserID ='" & txtusername & "'";
The problem is that when i want to change my password, the password was
not changed when i checked the table containing the userIDs and
password. Is something wrong here? Would it be helpful if i sent a
screen-shot of the macro if any kind soul could help me? I'm realli a
newbie at this..

Thnx lotsa..

Jan 11 '06 #7
thanxs once again for ur help, realli appreciate it..
however i got another problem..
Here's what i did..
i created a macro at the on-click event (macroChangePW);
i created conditions to check whether any of the textboxes were null;
i verified whether the userID is correct with the passwords in their
respective tables;
i created three different actions, running the 3 SQLs respectively

1)
UPDATE tblPasswordReceivi
SET tblPasswordReceivi.Password = '" & txtConfirmPW & "' WHERE
tblPasswordReceivi.UserID ='" & txtusername & "'";

2)
UPDATE tblPasswordPurchase
SET tblPasswordPurchase.Password='" & txtConfirmPW & "' WHERE
tblPasswordPurchase.UserID ='" & txtusername & "'";

3)
UPDATE tblPasswordMgmt
SET tblPasswordMgmt.Password='" & txtConfirmPW & "' WHERE
tblPasswordMgmt.UserID ='" & txtusername & "'";
The problem is that when i want to change my password, the password was
not changed when i checked the table containing the userIDs and
password. Is something wrong here? Would it be helpful if i sent a
screen-shot of the macro if any kind soul could help me? I'm realli a
newbie at this..

Thnx lotsa..

Jan 11 '06 #8

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

Similar topics

11
by: DFS | last post by:
Architecture: Access 2003 client, Oracle 9i repository, no Access security in place, ODBC linked tables. 100 or so users, in 3 or 4 groups (Oracle roles actually): Admins, Updaters and ReadOnly....
2
by: Joe Fetters via .NET 247 | last post by:
Have googled and read the VS.NET documentation can't seem to getthe answer to the following. Environment: Framework 1.1 VB.NET WinForm Access database Using all automagic tools (DataAdapter...
7
by: Mike | last post by:
Dear Group, I have a .NET 2.0 .DLL assembly containing a dataset with three tables. I reference this from a standalone .NET 2.0 EXE. I am writing a login form which uses the single Dataset from...
6
by: Darren | last post by:
hi y'all! i pretty much wanted to do a custom form where users can change their password to the database as they like.. the problem i encountered is that it seems that when a valid user enter...
2
by: mankolele | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Simple Database Connection</title> </head> <body bgcolor="white"> <?php $connection =...
4
by: custommx3 | last post by:
I have designed a site that requires users to login. Me being new to php, I hired a guy to help me setup the database. He set it up and it works flawlessly. Well.. instead of helping me finish the...
5
by: =?Utf-8?B?UlBhcmtlcg==?= | last post by:
I used the wizard to generate a typed dataset for my table and let it create my SPROCs. It created everything, and the GetData() method and the custom GetByUserName query works great, but when I...
3
by: DavidPr | last post by:
I've wrestled with this code all day and I just can't figure out what the problem is. I have this same code on the add_job.php page and the edit_job.php page and neither one is enter in the correct...
2
by: BobLewiston | last post by:
Some of you may have seen my earlier thread “PasswordHash NULL problem”. I’ve started a new thread because investigation has shown that the problem is actually quite different than I previously...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...

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.