Password protect a VB Front end

  • Thread starter Thread starter Trev
  • Start date Start date
T

Trev

Hey,

I have a complete frontend setup, the first window/form
that shows up gives you an option of 3 databases. One of
them will only need to be accessed by about 2 - 3 people
within our organization. so i want to password protect it.

How can i do this?

I was think i can just have a funtion so that when they
click on the button for the database i want password
protected a box pops up?

Any help would be great.

Thank you.
 
Trev said:
I was think i can just have a funtion so that when they
click on the button for the database i want password
protected a box pops up?

Hi... Network security is a large topic.

You can certainly implement a pop-up form easily and typically the routine
would validate against a table in your database. You usually want to make
certain that the user can't get to the database some other way (like
clicking on a folder) and discover the password that way.

But... I was going to suggest one small modification. Rather than prompt
when a user clicks on the one that "requires" a password... you might want
to require everybody to log in (it can be a simple procedure) to the app.
That way the database that shouldn't be accessed by most people wouldn't
even appear on the form.

If they are unaware of it's existance they won't spend time trying to get to
it.

Tom
 
We are not really that worried about the security as the
info it not that sensitive. On the other 2 databases the
1, its for our staffs trainging details and will be
accessed by our HR Manager, and maybe our induction
supervisor.

How can i program it to look for the password in a txt
box on another form?

This is what i currently have for my connection:

Private Function ConnectStringBuild() As String
Dim strConn As String

strConn &= "Data Source=ServerName;"
strConn &= "Initial Catalog=Train;"
strConn &= "User ID=User;"
strConn &= "Password=Password"

Return strConn
End Function

Any help would be great. Thanks.
 
Try This

Create A Password Form which has text boxes for UserID,
Password etc, an OK and Cancel Button.

Depending on where you store the password details you can
either hard code them in or store in a security database
or file.


Set Password Property of TextBox To Display Security
Characters (i.e. *****)

So when the user runs the form

Dim F As New Security Form

If F.ShowDialog= DialogResult.OK Then
'Code In Here To Set or retrieve Password and userID
information
Dim UserID As String
UserID= GetValues
Dim Password As String
Password= GetValues
If (F.UserIDTextBox.Text= UserID)And_
(F.PasswordTextBox.Text= Password) Then
Dim NextForm As New Form
NextForm.Show
Else
End 'Ends Application
End If
Else
End 'Cancel Program
End If
 
Excellent that helps, thanks.
-----Original Message-----
Try This

Create A Password Form which has text boxes for UserID,
Password etc, an OK and Cancel Button.

Depending on where you store the password details you can
either hard code them in or store in a security database
or file.


Set Password Property of TextBox To Display Security
Characters (i.e. *****)

So when the user runs the form

Dim F As New Security Form

If F.ShowDialog= DialogResult.OK Then
'Code In Here To Set or retrieve Password and userID
information
Dim UserID As String
UserID= GetValues
Dim Password As String
Password= GetValues
If (F.UserIDTextBox.Text= UserID)And_
(F.PasswordTextBox.Text= Password) Then
Dim NextForm As New Form
NextForm.Show
Else
End 'Ends Application
End If
Else
End 'Cancel Program
End If
.
 
Trev said:
We are not really that worried about the security as the
info it not that sensitive. On the other 2 databases the
1, its for our staffs trainging details and will be
accessed by our HR Manager, and maybe our induction
supervisor.

I noticed another reply had the code in it so on that front you seem to be
set... though I believe I noticed that the application exists on an
incorrect password and that's a bit much if they are otherwise allowed to
use the system.

BTW I think the password itself might be overkill given your needs. You can
just provide a "key" to the couple of people who need it in the form of a
value in an configuration file... or even just test for the presence of the
file itself.

The password isn't a problem but if the special users don't need to key it
in all the time it is just easier. You would make a point of giving those
people the special key file, your software would see it is there and the
database options would appear without the need to key in a password every
time.

Just a thought,
Tom
 
Back
Top