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

password protection

how do i write a macro for password protecting my access database, by creating a separate table for username and password so that more than one users can be authorized to access the database and also the password sanctity is maintained by assigning separate username and password for each user
Aug 14 '12 #1

✓ answered by ariful alam

You can do it.

1. Create a table called login has @list to field UserId and Password.
2. Create a unbound form for login having two text box (UserID and Password) and two button (Log in and Cancel).
3. Create a select query on login table that takes two parameters for loginid and password from the login form.
4. Create a form from the query created.
5. Make the queried form a sub form of the login form that not visible.
6. Now Add a Macro to the login captioned button in login form.

The marcro steps are given bellow.

a. MsgBox in action if user id not given.
b. StopMacro in action if user id not given.
c. MsgBox in action if password not given.
d. StopMacro in action if password not given.
e. Requery in action
f. MsgBox in action if user id and password in login form and user id and password in sub form not matched.
or
if user id and password in sub form null
g. StopMacro in action if user id and password in login form and user id and password in sub form not matched.
or
if user id and password in sub form null
h. MsgBox in action if user id and password in login form and user id and password in sub form matched.
or
if user id and password in sub form not null
i. Close in action with object selected form, name selected login form name
j. OpenForm in actin with object selected form, name selected form name that you like to open.

Hope it's help you. :)

2 1630
ariful alam
185 100+
You can do it.

1. Create a table called login has @list to field UserId and Password.
2. Create a unbound form for login having two text box (UserID and Password) and two button (Log in and Cancel).
3. Create a select query on login table that takes two parameters for loginid and password from the login form.
4. Create a form from the query created.
5. Make the queried form a sub form of the login form that not visible.
6. Now Add a Macro to the login captioned button in login form.

The marcro steps are given bellow.

a. MsgBox in action if user id not given.
b. StopMacro in action if user id not given.
c. MsgBox in action if password not given.
d. StopMacro in action if password not given.
e. Requery in action
f. MsgBox in action if user id and password in login form and user id and password in sub form not matched.
or
if user id and password in sub form null
g. StopMacro in action if user id and password in login form and user id and password in sub form not matched.
or
if user id and password in sub form null
h. MsgBox in action if user id and password in login form and user id and password in sub form matched.
or
if user id and password in sub form not null
i. Close in action with object selected form, name selected login form name
j. OpenForm in actin with object selected form, name selected form name that you like to open.

Hope it's help you. :)
Aug 14 '12 #2
Rabbit
12,516 Expert Mod 8TB
Just be aware that because Access is both the client and server, any security you attempt to apply to an access database can be undone by any user with access to it.
Aug 14 '12 #3

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

Similar topics

2
by: Boris | last post by:
I am wanting to set up password protection for an area on my website, so only our members can access this area. I am needing to do this using php as the domain hosts do not support asp I need a...
6
by: Lou | last post by:
Please can someone put me out my misery! Im trying to find a multiple user/password protection script that will redirect the specific user to a specific directory. At the moment I have set up...
7
by: juglesh | last post by:
<body><div align="center"> <?php if (!isset($password)){ ?><form action="<?php $_SERVER; ?>" method="post"> type password here&nbsp;<input name="password" type="text" size="8"> then <input...
2
by: chris | last post by:
Hi, I will be looking to use gatekeeper or some other javascript method of password protection but... Once there I need a way of resticting access to a page to stop someone from bookmarking...
7
by: Borked Pseudo Mailed | last post by:
Seeking feedback on Password Protection via Java/JavaScript ONLY (no cgi): SEE: http://online_tools.home.att.net/tools.html *AND* http://online_tools.home.att.net/extraCode.htm Thanks.
0
by: btopenworld | last post by:
Hi I have been using two forms of password protection: A) On working web sites I use an ASP script that is included in every page requiring protection: uses session - works fine B) On...
1
by: Cherish | last post by:
I am currently doing I.C.T coursework and would like password protection for my database. The only problem is I don't know how to create it lol. Plz if u have any ideas on how to get started etc do...
2
by: Hexadane | last post by:
Hi i need some help with password protection on a switchboard button.
0
by: vidhyapriya | last post by:
How do I Compress my Database with password (MS Access Database). Script Below was done if my database unlock with password protection, but when it lock... I've got an error : Cannot start your...
2
by: foekall | last post by:
Dear All, In my office is using Windows Server 2003 with IIS 6.0. When I access IIS 6.0 from internet browser I always need to type user name and password. So, I want to access without password...
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
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: 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
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,...
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.