get users account name

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
 
R

Rick Brandt

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")?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top