Home > Archive > MS SQL Server DTS > September 2005 > windows logged on username









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author windows logged on username
Andre

2005-09-27, 8:24 pm

SQL 2k sp4

As part of a DTS package, I want to use the name of the currently logged on
Windows user to populate a UserName field in my table. Can anyone tell me
how I can do this - get the name of the currently logged on user? I'm
figuring it can be done in an ActiveX step but don't know how.

Thanks in advance.

Andre


Andre

2005-09-27, 8:24 pm

Forget it, I just figured it out. Here's how in case anyone is interested.



Function Main()

Dim oWshNetwork

Set oWshNetwork = CreateObject("WScript.Network")

MsgBox("Current User Name: " & UCase(oWshNetwork.UserName))

Main = DTSTaskExecResult_Su
ccess
End Function


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com