Solved

Domain to which current user is logged on...

Posted on 2006-11-07
5
129 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
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

685 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