Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-24-2008, 12:09 AM
SF
 
Posts: n/a
Access and Windows login (AD)

Hi,

I was assign to develop an Admin Forms database for my office. It consists
of 20 or more form. Our HR personel adviced us not to allow browsing staff
information. Is there a way to capture login name of the current user from
AD? I want to bing this login name to the name of staff sothat staff who
uses the form can only select their own name (I want to restirct this
because if user can browse other staff name he/she can see the remaining
balance of the medical allowance, education of the other.).

TIA

SF


Reply With Quote
  #2 (permalink)  
Old 07-24-2008, 12:29 AM
pietlinden@hotmail.com
 
Posts: n/a
Re: Access and Windows login (AD)

On Jul 23, 7:09*pm, "SF" <x...@yahoo.com> wrote:
> Hi,
>
> I was assign to develop an Admin Forms database for my office. It consists
> of 20 or more form. Our HR personel adviced us not to allow browsing staff
> information. Is there a way to capture login name of the current user from
> AD? I want to bing this login name to the name of staff sothat staff who
> uses the form can only select their own name (I want to restirct this
> because if user can browse other staff name he/she can see the remaining
> balance of the medical allowance, education of the other.).
>
> TIA
>
> SF


this does it. You can filter the form in the open event to filter for
the user's NT Login ID.
http://www.mvps.org/access/api/api0008.htm
Reply With Quote
  #3 (permalink)  
Old 07-24-2008, 12:32 AM
Chris O'C via AccessMonster.com
 
Posts: n/a
Re: Access and Windows login (AD)

The code here will get the user's windows name:

http://www.mvps.org/access/api/api0008.htm

But you can't prevent users from browsing what's in the tables unless you add
security features. Put the data in SQL Server tables, where you can
administer security. The express version is free.

Chris
Microsoft MVP


SF wrote:
>Hi,
>
>I was assign to develop an Admin Forms database for my office. It consists
>of 20 or more form. Our HR personel adviced us not to allow browsing staff
>information. Is there a way to capture login name of the current user from
>AD? I want to bing this login name to the name of staff sothat staff who
>uses the form can only select their own name (I want to restirct this
>because if user can browse other staff name he/she can see the remaining
>balance of the medical allowance, education of the other.).
>
>TIA
>
>SF


--
Message posted via http://www.accessmonster.com

Reply With Quote
  #4 (permalink)  
Old 07-24-2008, 12:38 AM
Pete D.
 
Posts: n/a
Re: Access and Windows login (AD)

If security is that important then you need to move to SQL database. But if
your on a budget use access as a index to other files. Store file names and
keep the data outside of access in individual password protected documents.
But to answer your question
http://www.mvps.org/access/api/api0008.htm
will get you the logon name.
"SF" <xyz@yahoo.com> wrote in message
news:OTVGlIS7IHA.1592@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> I was assign to develop an Admin Forms database for my office. It consists
> of 20 or more form. Our HR personel adviced us not to allow browsing staff
> information. Is there a way to capture login name of the current user from
> AD? I want to bing this login name to the name of staff sothat staff who
> uses the form can only select their own name (I want to restirct this
> because if user can browse other staff name he/she can see the remaining
> balance of the medical allowance, education of the other.).
>
> TIA
>
> SF
>



Reply With Quote
  #5 (permalink)  
Old 07-24-2008, 01:56 AM
SF
 
Posts: n/a
Re: Access and Windows login (AD)

Hi Chris,

Thank you for your advice.

My FE is connected to SQLServer 2005 back end. I modify my table to add a
column 'Owner' and assigh SUSER_SNAME() as default value. I found that
SUSER_SNAME() return Domain\Username which does not match value provided by
fOSUserName() which return only username.

How to store only username in the Owner column?

SF


"Chris O'C via AccessMonster.com" <u29189@uwe> wrote in message
news:8799efd28c263@uwe...
> The code here will get the user's windows name:
>
> http://www.mvps.org/access/api/api0008.htm
>
> But you can't prevent users from browsing what's in the tables unless you
> add
> security features. Put the data in SQL Server tables, where you can
> administer security. The express version is free.
>
> Chris
> Microsoft MVP
>
>
> SF wrote:
>>Hi,
>>
>>I was assign to develop an Admin Forms database for my office. It consists
>>of 20 or more form. Our HR personel adviced us not to allow browsing staff
>>information. Is there a way to capture login name of the current user from
>>AD? I want to bing this login name to the name of staff sothat staff who
>>uses the form can only select their own name (I want to restirct this
>>because if user can browse other staff name he/she can see the remaining
>>balance of the medical allowance, education of the other.).
>>
>>TIA
>>
>>SF

>
> --
> Message posted via http://www.accessmonster.com
>



Reply With Quote
  #6 (permalink)  
Old 07-24-2008, 02:37 AM
Chris O'C via AccessMonster.com
 
Posts: n/a
Re: Access and Windows login (AD)

Technically, domain\username is correct, since Regents\JohnSmith and Staff\
JohnSmith may not be the same user. But I think you don't want to see the
domain name in your table because everyone is on the same domain, so it's
redundant.

You have several alternatives. You could write a select query that uses vba
to only show the username, even though the domain name is stored in the table
with the username. This is probably the easiest.

If you want to keep SUSER_SNAME() as the default value, you could write a
trigger in Transact sql to fix it after the row is created. You could write
a stored procedure in Sql Server or a query in Access to update the column so
it removes the domain name in a specific row or in every row. You could
write a vba procedure in Access to update the column.

Or you could skip having SUSER_SNAME() as the default value. Write a vba
procedure that inserts the value of fOSUserName when the record is created.
Probably the form's after insert event would be best.

Chris
Microsoft MVP


SF wrote:
>Hi Chris,
>
>Thank you for your advice.
>
>My FE is connected to SQLServer 2005 back end. I modify my table to add a
>column 'Owner' and assigh SUSER_SNAME() as default value. I found that
>SUSER_SNAME() return Domain\Username which does not match value provided by
>fOSUserName() which return only username.
>
>How to store only username in the Owner column?
>
>SF
>
>> The code here will get the user's windows name:
>>

>[quoted text clipped - 21 lines]
>>>
>>>SF


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200807/1

Reply With Quote
  #7 (permalink)  
Old 07-24-2008, 07:10 AM
SF
 
Posts: n/a
Re: Access and Windows login (AD)

Thank you. I will try my best.

SF

"Chris O'C via AccessMonster.com" <u29189@uwe> wrote in message
news:879b0773705ce@uwe...
> Technically, domain\username is correct, since Regents\JohnSmith and
> Staff\
> JohnSmith may not be the same user. But I think you don't want to see the
> domain name in your table because everyone is on the same domain, so it's
> redundant.
>
> You have several alternatives. You could write a select query that uses
> vba
> to only show the username, even though the domain name is stored in the
> table
> with the username. This is probably the easiest.
>
> If you want to keep SUSER_SNAME() as the default value, you could write a
> trigger in Transact sql to fix it after the row is created. You could
> write
> a stored procedure in Sql Server or a query in Access to update the column
> so
> it removes the domain name in a specific row or in every row. You could
> write a vba procedure in Access to update the column.
>
> Or you could skip having SUSER_SNAME() as the default value. Write a vba
> procedure that inserts the value of fOSUserName when the record is
> created.
> Probably the form's after insert event would be best.
>
> Chris
> Microsoft MVP
>
>
> SF wrote:
>>Hi Chris,
>>
>>Thank you for your advice.
>>
>>My FE is connected to SQLServer 2005 back end. I modify my table to add a
>>column 'Owner' and assigh SUSER_SNAME() as default value. I found that
>>SUSER_SNAME() return Domain\Username which does not match value provided
>>by
>>fOSUserName() which return only username.
>>
>>How to store only username in the Owner column?
>>
>>SF
>>
>>> The code here will get the user's windows name:
>>>

>>[quoted text clipped - 21 lines]
>>>>
>>>>SF

>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...ccess/200807/1
>



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:40 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109