get users account name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have added this code snippet to my database to get currently logged on
users account name. I get an error message "Activex component can't create
object". i have renamed acwzmain.mde , acwztool.mde, and acwzlib.mde and run
the repair utility but still get same error message. Here is the code:

Dim objNet As Object
Dim strUserName As String
Dim strUserDomain As String
Dim strComputerName As String

Set objNet = CreateObject("WScipt.Network")
strUserName = objNet.UserName
strUserDomain = objNet.UserDomain
strComputerName = objNet.ComputerName
Set objNet = Nothing
 
JNS said:
I have added this code snippet to my database to get currently logged
on users account name. I get an error message "Activex component
can't create object". i have renamed acwzmain.mde , acwztool.mde, and
acwzlib.mde and run the repair utility but still get same error
message. Here is the code:

Dim objNet As Object
Dim strUserName As String
Dim strUserDomain As String
Dim strComputerName As String

Set objNet = CreateObject("WScipt.Network")
strUserName = objNet.UserName
strUserDomain = objNet.UserDomain
strComputerName = objNet.ComputerName
Set objNet = Nothing

Should that be CreateObject("WScript.Network")?
 
Back
Top