473,394 Members | 1,787 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,394 software developers and data experts.

Password protection

Hi i need some help with password protection on a switchboard button.
Apr 11 '07 #1
2 1234
ADezii
8,834 Expert 8TB
Hi i need some help with password protection on a switchboard button.
Please provide more details.
Apr 11 '07 #2
pks00
280 Expert 100+
Are you saying u want to prompt for a password on a click of a button.

Simplest way - using hardcoding, say your button was called cmdTest

Expand|Select|Wrap|Line Numbers
  1. private cmdTest_Click()
  2.     Dim sPswd as String
  3.  
  4.     sPswd = NZ(InputBox("Enter Password"),"")
  5.     if sPswd <> "somevalue" then
  6.          msgbox "Password incorrect"
  7.          exit sub
  8.     else
  9.          'continue processing
  10.     end if
  11. end sub
  12.  
Now of course, its best to store passwords in a table somewhere, u may find u have different passwords for different things
So u could perform a dlookuo

Expand|Select|Wrap|Line Numbers
  1. private cmdTest_Click()
  2.     Dim sPswd as String
  3.     Dim sValidPswd as String
  4.  
  5.     'Look up field pwd in table tblPassword
  6.     sValidPswd = DLOOKUP("pwd","tblPasswords")
  7.     sPswd = NZ(InputBox("Enter Password"),"")
  8.  
  9.     if sPswd <> sValidPswd then
  10.          msgbox "Password incorrect"
  11.          exit sub
  12.     else
  13.          'continue processing
  14.     end if
  15. end sub
  16.  

U could also add criteria into your dlookup

'Look up field pwd in table tblPassword where field op = fred
sValidPswd = DLOOKUP("pwd","tblPasswords","op='fred'")


Of course using inputbox, u cannot mask the input. It is possible but u would need to make use of callback functions. Other way of course is to open up a form and do it.
Apr 11 '07 #3

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

Similar topics

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...
10
by: Max | last post by:
Hello all, I am trying to protect a page within my site with a JS password scheme. Now I know JS can be quite easily "circumvented", but I came by a code below. My question is: 1. Is there...
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.
3
by: Miro | last post by:
Why Password protect an MDB when someone can google and get a hack? Wondering if anyone else has thought of this and just said "oh well"... I plan to password protect an MDB where I have some...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.