Environ() As Login?

Mar 9, 2006

Hello,

I use Environ("Username") all the time, most frequently for logging who has done something to a record, and have once used it to log people into the database (very basic, much the same as logging who did what to records).

But I was wondering, how feasible is it as a security measure?

I often use it on the main menu of my DBs to give me a different menu (with more advanced options on) than other users.

Is it really that safe to use it as a means to allow people in, or stopping them? I know that obviously you have to stop them getting in other ways (holding shift for example), but assuming all of that is done, in theory, they should only be able to get in if they can log in as an authorised user?

Don't know why it is just struck me - just curious I suppose!

View Replies


ADVERTISEMENT

Login SQL Server Linked Tables Automatic On Event Load Of Login Form

Apr 17, 2015

I have a ms access application in Front End and linked tables to sql server 2008 r2 in back end.. every time I open my application the linked tables ask to me for the user and password of the sql server user of the odbc conection. I want to connect to my sql database without login every time the user open the application, I know that can be possible if I start session from vba code...

View 2 Replies View Related

Forms :: Login Form On Opening Access Asking For Password And Login Name

Jun 17, 2013

I have access 2010, I currently have a database in place and operational. What I am wondering is there a way to have a form come up whenever someone opens access and asks for a password and login name. Also I would like to have a 2 tier system. One for Admins and the other for users with limited access.

Is this even possible to accomplish?

View 2 Replies View Related

Environ

Oct 10, 2006

I was given this piece of code the other day by somebody on the forum and it works really well. My question is:

Is there a way, using a similar function that I can retrive the IP address?

Environ("ComputerName")

View 4 Replies View Related

Network Environ Help

Nov 10, 2006

Hi everyone

I have searched for help on this forum and all over for a while but cannot find the help i need.

I have a database stored in my user area on a schools network. Other users around the school access the database by clicking on a shortcut to it found on their start menu. The database is not split with a fe/be and usernames and passwords are not required to log on, they simply click the link.

I would like to know how I can find out which users have the database open at any given time? I have a piece of software that tells me the computer name but that is no use, I need the users name. Is there a way of pulling this from the network because each user must first log on to their computer using their name and password before they can access the database?

Any suggestions appreciated
James

View 3 Replies View Related

Environ Function In A97

Mar 10, 2005

i have a menu which recognises a user by using the environ function.

the problem i am getting is that with a small number of users the environ function isnt recognised by the system?

it gives them a #name# instead.

the crazy thing is that it also happens on simpler functions such as =Now() and =Date() which is really annoying, as these 3 things are a foundation on anything that is done within the system/!

the majority of users have no problems, which makes it even more annoying!

when i try to go into the properties of the label which has been assigned the function i get a message. (only on affected PC's)

see attached for pic

THANK YOU IN ADVANCE. HELP IS REALLY APPRECIATED!

View 12 Replies View Related

Environ Variable

Mar 19, 2006

I have written a code in VBA to get username. The code is strUserName = Environ("Username")

This doesn't seem to work in some computers. Any idea why?

View 3 Replies View Related

Modules & VBA :: Use The Environ Username Somewhere In The Db?

Mar 27, 2014

Using Win 7 and Access 2007

db will be split and on a server

If it's possible: Would like to use the Environ username somewhere in the db so the user only sees their records.
Where would I place this? Or is their different code I should be using for this purpose???

View 5 Replies View Related

Modules & VBA :: Environ Username Function - Comparing Results

Apr 8, 2014

I am trying to use the Environ Username function, which i have working! But i want to compare the result with a Username Table to determine if they have access etc...

View 13 Replies View Related

Environ$("USERNAME") And Access 2003

Dec 31, 2006

How do I use the following as the default value of a textbox in Access2003?
Environ$("USERNAME")

Resolution:

Create Module and insert the following code:

Option Compare Database
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
On Error GoTo fOSUserName_Err

Dim lngLen As Long, lngX As Long
Dim strUserName As String

strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)

If lngX <> 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = ""
End If


fOSUserName_Exit:
Exit Function

fOSUserName_Err:
MsgBox Error$
Resume fOSUserName_Exit
End Function

Use this function as default value
=fOSUserName()

View 9 Replies View Related

=Environ("UserName") Not Working In Query

Aug 16, 2005

Hi I am using the below code for getting Windows Username, this code is working fine when i am using this in lable, however if i use this in a query, it is not working, do it need some kind of autorun?

SELECT Associates.*
FROM Associates
WHERE (((Associates.CorpID)=Environ("UserName")));

Please help.

View 2 Replies View Related

=Environ("username")

Jun 14, 2005

I have noted a problem on 2 computers using this. There are around 30 or so computers on our network that work fine with this as a value. The majority of the users are at Access 2000 but some have Access XP. The offending machines have Access 2000

One day a persons computer crashed. DP imaged another persons machine and installed the image on the crashed machine as a solution. Since this the =Environ("username") returned #Name$ (not sure of the exact syntax on this). This same trouble surfaced on another machine recently. I unlocked the field so the users could enter their correct name but this can lead to errors and I would like to keep the username locked and read by code.

I checked the references on the offending machine and they were ok. Not sure what else there is to do to rectify this.

If anyone else has had a similar trouble and found the solution I would appreciate hearing about it.

Thanks a lot!!
-----------------------------
Edit:
I just checked the machine and corrected the syntax above. I also found that in a date search form where I have =now$() for a field, the same thing is displayed - #Name$ rather than the date.

View 9 Replies View Related

Tab Login.

Sep 1, 2005

On my login form, after the user enters the username and password he will have to go manually using the mouse to point at the Enter command button, is it possible to make in a way that after the user enters the password and hit enter proceeds as clicking on the enter command button

View 3 Replies View Related

Look Up Name From Login

Dec 15, 2006

I have created a form and modual to capture the current user. The problem is I want to use this infomation to populate a name field in my project form. The modual and form are capturing the login name of tpeter which is correct, but that is not listed name that I want. I need to to associate tpeter with Tim Peter and automaticaly fill in the field. Here is the sql of the field in the project form:

SELECT [tblemployee].[UserId], [tblemployee].[FirstName] & " " & [tblemployee].[LastName] AS Expr1 FROM tblemployee;

Here is the SQL for the Modual:

Option Compare Database
Private Declare Function GetUserName Lib "ADVAPI32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long

Public Function GetCurrentUserName() As String
On Error GoTo Err_GetCurrentUserName
Dim lpBuff As String * 25
Dim ret As Long, Username As String
ret = GetUserName(lpBuff, 25)
Username = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
GetCurrentUserName = Username & ""

Exit_GetCurrentUserName:
Exit Function

Err_GetCurrentUserName:
MsgBox Err.Description
Resume Exit_GetCurrentUserName
End Function

I am still learning Access and coding so I am not sure exactly what everything means yet.

View 1 Replies View Related

Login

Oct 16, 2006

At the moment i have a straight forward login form, were if the username matches to the password the user can log in otherwise they cannot. However i need a login based on access rights. For example if a user A log in he is the administrator and has access to all the tables, to be able to synchronise, add/delete records. However if it is user B they can only read thad inforation form the datasbase.
one way i was thinking was about trying to enable and disable certain command buttons on a form. If the users is not admin to disable the add button etc.
Has anybody got any other ideas, or do u think this is suitable, or any examples of login screens

View 2 Replies View Related

Login

Oct 16, 2004

Hi all

I downloaded the attached free login script from somewhere. I configured it so that it points to my website index page after validation.

I've added another field in the database called delegation. An admin delegation would point to a separate index page with admin options allowing the user extra privelleges. I'd like to add a few more lines of code to the check_user.asp page to allow this. Any ideas. I appreciate any help.

Database password: letmein

Thanks

View 1 Replies View Related

Set Up The User Login

Sep 27, 2005

I have finished the database application, and now want to make a user login for specific users to run the application (but not to change the internal desgin or data).

How can it be done ?
Do I need to split the database first before doing that ? :confused:

View 1 Replies View Related

Login Screens

Oct 25, 2005

How do you set up a login screen (not the standard Database Password) within MS Access 2000

(So that a username and password must be input before opening the database)

View 3 Replies View Related

Login And Logout

Jan 17, 2006

Hi.. Been trying to work this out for a little while now. I run an IT workshop for adults with learning issues and although my other office skils are pretty good, my Access skills are a little lacking.

My clients login and out on paper at the moment but I would like to change this to a database type system. The entries would only be name and an automatic one to record actual time of login.

Can anybody help me with the automatic entries?

Many thanks
Hoodlums

View 4 Replies View Related

Get The Login User Name ?

Jan 26, 2008

Hi,
I need to capture the windows user name who modifies the data in the form/table, is there a function or command to capture it in access 2007 ?

Thanks for the help
Joy

View 4 Replies View Related

Login Form

Aug 7, 2006

Dear all,
I have an application includes one table "info" and two forms "frmlogin" & "frmwelcome".
The table "info" contains many columns, two of them are [UserName] and [PassWord]. This table is filled with three records. "frmlogin" form contains two text boxes and one button. I want the user to enter user name and the password in those two text boxes, and when clicking the button, I want the application if that user is registered or no. If yes, he/she will be moved to the "frmwelcom", that display "Welcome [UserName]".

I did it, but I don't know where my error is.

See the attached file.

Sorry for bothering you.

Thanks & Regards

Mark K.

View 2 Replies View Related

Simple Login

Sep 10, 2004

Hi all,

I would like to create a simple login system for my db whereby users differentiated by approvers (people who approve PO forms) or preparers (people who prepare PO forms). The problem is, I do not know where to carry on after creating the form for login. How do I go about doing it? I have seen some samples but I do not really understand the code. Hope that someone will be able to guide me along. Thanks a million.

Regards,
Swee

View 2 Replies View Related

Access Login

Oct 21, 2004

How can I create a login form in Access to track user's input and the date and time of the input. I need to be able to see who entered specific information into the main form. On my main form I have a button to open a query and send that information to a text file but I would like the information to sent to the text file tab delimited. So far I have only been able to get it to go into the text file with comas to separate the columns. Any ideas on how to do these two things?

Thanks

View 1 Replies View Related

Problems With Code For Login. Please Help

Apr 12, 2006

Hi there

Im having a few problems trying to get my login form to function properly. I have created a username and login form.
- created 2 unbound text boxes with user and password
- created a button that performs the function of calling the username and password based on whether the user enters the password correctly.

When you input the password it continue to prompt you to enter the password when it is the correct password.

Does anyone know how to get around this?

Thanks
database attached + code for command below

Private Sub cmdLogin_Click()

'Check to see if data is entered into the UserName combo box

If IsNull(Me.cboEmployee) Or Me.cboEmployee = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cboEmployee.SetFocus
Exit Sub
End If

'Check to see if data is entered into the password box

If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If

'Check value of password in tblEmployees to see if this matches value chosen in combo box

If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", "[lngEmpID]=" & Me.cboEmployee.Value) Then

lngMyEmpID = Me.cboEmployee.Value

'Close logon form and open frm Load

DoCmd.Close acForm, "frm Test", acSaveNo
DoCmd.OpenForm "frm Load"

Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If

'If User Enters incorrect password 3 times database will shutdown

intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database. Please contact your system administrator.", vbCritical, "Restricted Access!"
Application.Quit
End If

End Sub

View 5 Replies View Related

Login Form Problem

Nov 24, 2005

Hi all

I need help with my Video rental store project the problem is that I want a security login method works with the my requirements. The manager has his own form with all the information he need and the other employees has another form.

I used this tutorial http://www.databasedev.co.uk/login.html to make the login form

the employee tables has ID, Password, Access Level

The VB code is like this

Option Compare Database
Private intLogonAttempts As Integer
Private Sub Form_Open(Cancel As Integer)
'On open set focus to combo box
Me.cboEmployeeLogOn.SetFocus
End Sub

Private Sub cboEmployeeLogOn_AfterUpdate()
'After selecting user name set focus to password field
Me.txtPassword.SetFocus
End Sub

Private Sub btnLogin_Click()

'Check to see if data is entered into the UserName combo box

If IsNull(Me.cboEmployeeLogOn) Or Me.cboEmployeeLogOn = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cboEmployeeLogOn.SetFocus
Exit Sub
End If

'Check to see if data is entered into the password box

If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If

'Check value of password in tblEmployees to see if this
'matches value chosen in combo box

If Me.txtPassword.Value = DLookup("EmployeePassword", "tblEmployee", "[EmployeeID]=" & Me.cboEmployeeLogOn.Value) Then

lngMyEmpID = Me.cboEmployeeLogOn.Value

'Close logon form and open splash screen

DoCmd.Close acForm, "frmLogon", acSaveNo
DoCmd.OpenForm "frmMainMenu"

Else



MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If

'If User Enters incorrect password 3 times database will shutdown

intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.", vbCritical, "Restricted Access!"
Application.Quit
End If

End Sub

I am asking for two things. First I want the Manger go to his form after the login completed and all the other employees go to another form I specify.

Second if there is a way that I show the name of the Employee in the destination form by knowing his ID (passing the ID to the other form).

That’s all if any one can help please

View 2 Replies View Related

Access Login Porblems - HELP

Feb 6, 2006

Hi,

Before we start - I'm a web dev / sql server grunt. I don't have much experience with access.

We've just performed our PC roll-over and we've moved from Access 2000 to 2003. We have alot of DB's around and some of which have *.mdw's. After the rollover was complete I've gone to the required computers and from ther 'Joined' the work group through the work group administration tool. This allowes the users into the required DB via the correct login.

HOWEVER.... drum roll.

No other databases which don't have any workgroups or logins are displaying the same login from my first DB. Entering the log and pass from the first database will then let you into this unrelated DB.

Does anyone have any ideas on how I can fix this problem?

Thanks for reading

Cam

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved