Unix Technical Forum

Capture NT User ID

This is a discussion on Capture NT User ID within the SQL Server forums, part of the Microsoft SQL Server category; --> Access front-end, SQL Server 2005 backend. I have users connected to SQL Server via a Microsoft Access user- interface. ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 02:49 PM
bubbles
 
Posts: n/a
Default Capture NT User ID

Access front-end, SQL Server 2005 backend.

I have users connected to SQL Server via a Microsoft Access user-
interface.
Connection is via NT login.

I want to log users' activities to the database with their userid.

How can I capture their NT User ID (via VBA in Access)?

Thanks,
Bubbles

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 02:49 PM
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a
Default Re: Capture NT User ID

You could create a view in SQL Server, I guess, like:

CREATE VIEW dbo.NTUsername
AS
SELECT [username] = SUSER_SNAME();

Now VBA should be able to query from that view in SQL Server just like it
would any other table or view...

--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006




"bubbles" <bubbles.one@hotmail.com> wrote in message
news:1175737278.694527.78540@q75g2000hsh.googlegro ups.com...
> Access front-end, SQL Server 2005 backend.
>
> I have users connected to SQL Server via a Microsoft Access user-
> interface.
> Connection is via NT login.
>
> I want to log users' activities to the database with their userid.
>
> How can I capture their NT User ID (via VBA in Access)?
>
> Thanks,
> Bubbles
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:11 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com