Solved

Password

Posted on 1998-08-27
12
154 Views
Last Modified: 2010-04-30
Hi,
I am currently writing a program using VB5 and Access.
I have 25 people who want to access this program and the database. I created a table with their names and passowrds but could not call to work with VB5. some of those people are able to add and delete and some for ReadOnly.Can you tell me please how create a form asking the user for his name and password, and if he is allowed to add and delete from the databse, if not, he can read only this databse!
Please help me with this code! thank you
0
Comment
Question by:hadorth11
  • 8
  • 3
12 Comments
 

Author Comment

by:hadorth11
ID: 1431509
Edited text of question
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1431510
In your program:
Have sub that chack for password.
I password is in a list that you will have on a registry or text file or ini file or
NOT recomended in the program itself.

Then when you open the database have the condition checked.

I will post here a password form but it is easy to have as a text box when password
property is ****

0
 
LVL 2

Expert Comment

by:seahpc
ID: 1431511
CReate 2 textbox name them username and password
Set the password textbox with property passwordchar .
Create a button .

Under the Click event .
Do something like this :
dim db as database
dim record as recordset

Set db = opendatabase(".../aaa.mdb")
SQL = "Select * FROM Login Where Username = '" & Username.text & "' AND Password = '" & Password.text & "'"
Set rec = db.openrecordset(SQL)

if Rec.eof then
    msgbox "Wrong Password or User not Found ! "
end if

Above will check whether the user login is valid .

To Allow Readonly and Add/Delete , maybe you can add a field to
SPecify Let say if the field is 1 then the user can only read .

0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:hadorth11
ID: 1431512
can you please tell me how to do it! thanks
0
 

Author Comment

by:hadorth11
ID: 1431513
It's not clear. Please I need clear answer! The program is insttaled in the server and yet, can't use if for security reasons!
thanks
0
 
LVL 3

Accepted Solution

by:
a111a111a111 earned 50 total points
ID: 1431514
Hi,
I made this code just fast in a few minutes and I hope it will give you a simple answer to the concept.

================  start ==========

Option Explicit

Private Sub Command1_Click()
Dim ChkPswd1
ChkPswd1 = Text1.Text
If Text1.Text = "Allen" Then
    MsgBox "All mode allows..."
Else
    MsgBox "ReadOnly"
End If
End Sub

Private Sub Command2_Click()
Dim ChkPswd2
Dim Ver1
Dim Ver2

ChkPswd2 = Text1.Text
Ver1 = Mid(ChkPswd2, 1, 1)
Ver2 = Right(ChkPswd2, 1)

If Ver1 = "A" And Ver2 = "A" Then
    MsgBox "All mode allows..."
    'your code here ''''
Else
    MsgBox "ReadOnly"
    'your code here ''''
End If

End Sub

Private Sub Form_Load()
Text1.PasswordChar = "*"
End Sub

I hope it helps.

0
 

Author Comment

by:hadorth11
ID: 1431515
I will try it and let you know, thanks

0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1431516
Hey whats wrong here I sent the code start with
Hi,
       I made this code just fast in a few minutes and I hope it will give you a simple answer to the concept.

       ================  start ==========

       Option Explicit

       Private Sub Command1_Click()
       Dim ChkPswd1

...............


How came this EE system made it as hadorth11 instad of my a111a111a111

?????????????
?????????????
0
 

Author Comment

by:hadorth11
ID: 1431517
thanks, I will try it and get back to you

0
 

Author Comment

by:hadorth11
ID: 1431518
thanks
0
 

Author Comment

by:hadorth11
ID: 1431519
i got the code, thanks
I will try it and let you know a111a111a111
0
 

Author Comment

by:hadorth11
ID: 1431520
can you email me the code for the password ! I am working on it now and still having problems! I would appreciate if you can email me more specific code for the password!
Thank you
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA Word macro - how to get characters after the searched for string 5 93
Exit a vb6 apps when a calling it apps closes 15 52
Add and format columns in vb6 7 63
MsgBox 4 68
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question