Solved

Domain to which current user is logged on...

Posted on 2006-11-07
5
132 Views
Last Modified: 2010-04-30
i saw that someone had quoted in another question that

environ("DOMAINNAME") should work, but it didn't.

so how can i find out the "domain name" which is shown on "my computer" window, should work on xp and 2000.

also what happens when this is called on a "2003 server"?
0
Comment
Question by:expertfan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 500 total points
ID: 17895699
Its:

Environ("UserDomain")


But if you dont want to do that, here is an API solution (i prefer this method anyway):

http://vbnet.mvps.org/index.html?code/network/getdomainname.htm


Good Luck..
Brian
0
 
LVL 4

Expert Comment

by:JRCSystems
ID: 17903372
I agree with Brian.

In addition, just in case you don't know...

Do Start/Run, type in CMD and press [Enter].

Type in SET and press [Enter].
It will show you ALL of the Environment variables set on the computer and their values.

JRC
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month5 days, 5 hours left to enroll

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question