473,698 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting windows user name

(This was also posted to comp.database.m s-access before I realized this was
the hep group.)

Lets say that my WinXP computer has two users: Michael and Kathryn. One or
the other logs into the computer and opens up an Access database (I happen
to be using 2002). There is no security on the database -- just click on the
shortcut and you're in.

I want to be able to determine who opened that database by knowing who
logged into the computer.

Is there a way to get the windows user name?

I have another question, and this one may be a bit off-topic, but I'll run
it up the flagpole.

I want to leave the above-named database open all the time, such that
whenever anybody logs in at the windows login screen, the database will be
up and running. In the actual application there may be as many as twenty
people accessing the same application, and I don't want twenty instances of
the program running -- one for each user. Can I have that database display
on the screen of all users? (Specifically, I would like to use Windows Fast
User Switching to change users.)

In most situations, I could resolve these issues using Access' security
features. This is a unique application, though, and the users won't be able
to log into the database themselves.

Thanks!

Mike

Nov 13 '05 #1
5 8130
Windows user name:
http://www.mvps.org/access/api/api0008.htm

The multi-user approach you suggest is not recommended. Instead, split the
database, and give each user their own local copy of the front end. More
info on this approach:
http://members.iinet.net.au/~allenbrowne/ser-01.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Mike Turco" <mi*******@yaho o-nospam4me.com> wrote in message
news:aGWYc.1745 18$sh.173430@fe d1read06...
(This was also posted to comp.database.m s-access before I realized this
was
the hep group.)

Lets say that my WinXP computer has two users: Michael and Kathryn. One or
the other logs into the computer and opens up an Access database (I happen
to be using 2002). There is no security on the database -- just click on
the
shortcut and you're in.

I want to be able to determine who opened that database by knowing who
logged into the computer.

Is there a way to get the windows user name?

I have another question, and this one may be a bit off-topic, but I'll run
it up the flagpole.

I want to leave the above-named database open all the time, such that
whenever anybody logs in at the windows login screen, the database will be
up and running. In the actual application there may be as many as twenty
people accessing the same application, and I don't want twenty instances
of
the program running -- one for each user. Can I have that database display
on the screen of all users? (Specifically, I would like to use Windows
Fast
User Switching to change users.)

In most situations, I could resolve these issues using Access' security
features. This is a unique application, though, and the users won't be
able
to log into the database themselves.

Nov 13 '05 #2

"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:41******** **************@ per-qv1-newsreader-01.iinet.net.au ...
Windows user name:
http://www.mvps.org/access/api/api0008.htm

The multi-user approach you suggest is not recommended. Instead, split the
database, and give each user their own local copy of the front end. More
info on this approach:
http://members.iinet.net.au/~allenbrowne/ser-01.html


Hi Allen,

I'm not sure that splitting the database is the way to go. I have a single
computer that will be used by several different people. I want to use Fast
User Switching to log people in-and-out of the system. The system gets a lot
of use and I don't want the lines to get any worse. I can't create a network
to reduce wait time because the database controls a single, unique
instrument. Having users log in-and-out of Access isn't an option because I
have to close and re-open Access, which is time consuming. I want to use
Windows fast user switching feature if I can.

I am reading your post as suggesting that each user have their own front
end. That would mean that as many as twenty users each have a copy of Access
open. That sounds, to me, like a pretty big load on the computer.

Thanks for your help.

Mike
Nov 13 '05 #3
Mike Turco wrote:
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:41******** **************@ per-qv1-newsreader-01.iinet.net.au ...
Windows user name:
http://www.mvps.org/access/api/api0008.htm

The multi-user approach you suggest is not recommended. Instead, split the
database, and give each user their own local copy of the front end. More
info on this approach:
http://members.iinet.net.au/~allenbrowne/ser-01.html

Hi Allen,

I'm not sure that splitting the database is the way to go. I have a single
computer that will be used by several different people. I want to use Fast
User Switching to log people in-and-out of the system. The system gets a lot
of use and I don't want the lines to get any worse. I can't create a network
to reduce wait time because the database controls a single, unique
instrument. Having users log in-and-out of Access isn't an option because I
have to close and re-open Access, which is time consuming. I want to use
Windows fast user switching feature if I can.

I am reading your post as suggesting that each user have their own front
end. That would mean that as many as twenty users each have a copy of Access
open. That sounds, to me, like a pretty big load on the computer.

Thanks for your help.

Mike

Prepare yourself, it doesn't work like that, each fast switched user
will have their own copy of Access loaded into memory so even if you can
get around any locking problems of them all opening the same database
directly they will still be using nearly 100MB RAM just for the logon
session and a copy of Access with no database loaded (I just tested this
under XP, the second msaccess.exe is only using 2MB, couldn't open the
same database BTW), loadin a database will increase this useage,
regardless of if it's a shared or separate copy as it will be another
instance.

What I did in a similar situation, 4 guys in a warehouse, 1 computer (A
P75 with Win 3.11, 95 was still coming of age) was to implement my own
security, just user name and password when entering a form. I did this
for the reason you specify, too long to load up Access for each user.

--

\\\\\\
\\ \\ Windows is searching
\ \ For your sig.
\ \ Please Wait.
\__\

Nov 13 '05 #4

"Trevor Best" <nospam@localho st> wrote in message
news:41******** *************** @auth.uk.news.e asynet.net...
Mike Turco wrote:
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:41******** **************@ per-qv1-newsreader-01.iinet.net.au ...
Windows user name:
http://www.mvps.org/access/api/api0008.htm

The multi-user approach you suggest is not recommended. Instead, split thedatabase, and give each user their own local copy of the front end. More
info on this approach:
http://members.iinet.net.au/~allenbrowne/ser-01.html

Hi Allen,

I'm not sure that splitting the database is the way to go. I have a single computer that will be used by several different people. I want to use Fast User Switching to log people in-and-out of the system. The system gets a lot of use and I don't want the lines to get any worse. I can't create a network to reduce wait time because the database controls a single, unique
instrument. Having users log in-and-out of Access isn't an option because I have to close and re-open Access, which is time consuming. I want to use
Windows fast user switching feature if I can.

I am reading your post as suggesting that each user have their own front
end. That would mean that as many as twenty users each have a copy of Access open. That sounds, to me, like a pretty big load on the computer.

Thanks for your help.

Mike

Prepare yourself, it doesn't work like that, each fast switched user
will have their own copy of Access loaded into memory so even if you can
get around any locking problems of them all opening the same database
directly they will still be using nearly 100MB RAM just for the logon
session and a copy of Access with no database loaded (I just tested this
under XP, the second msaccess.exe is only using 2MB, couldn't open the
same database BTW), loadin a database will increase this useage,
regardless of if it's a shared or separate copy as it will be another
instance.

What I did in a similar situation, 4 guys in a warehouse, 1 computer (A
P75 with Win 3.11, 95 was still coming of age) was to implement my own
security, just user name and password when entering a form. I did this
for the reason you specify, too long to load up Access for each user.


What you're saying makes sense.

Another issue here is that the database controls an instrument through USB,
and that may add a whole new level of headache if I create a setup that is
more complex than what it needs to be.

Thanks,

Mike
Nov 13 '05 #5
If you are still interested in how to get the current logged on user
the following code will do so.

'Declared Globally
Private Declare Function GetUserNameAPI Lib "advapi32.d ll" _
Alias "GetUserNam eA" (ByVal lpbuffer As String, _
nSize As Long) As Long

Public Function GetUserName() As String
Dim sBuffer As String
Dim lSize As Long

' Space for dll parameters
sBuffer = Space$(255)
lSize = Len(sBuffer)

Call GetUserNameAPI( sBuffer, lSize)

If lSize > 0 Then
' Remove empty spaces
GetUserName = Left$(sBuffer, lSize - 1)
Else
' Return empty if no user is found
GetUserName = vbNullString
End If

End Function

"Mike Turco" <mi*******@yaho o-nospam4me.com> wrote in message news:<aGWYc.174 518$sh.173430@f ed1read06>...
(This was also posted to comp.database.m s-access before I realized this was
the hep group.)

Lets say that my WinXP computer has two users: Michael and Kathryn. One or
the other logs into the computer and opens up an Access database (I happen
to be using 2002). There is no security on the database -- just click on the
shortcut and you're in.

I want to be able to determine who opened that database by knowing who
logged into the computer.

Is there a way to get the windows user name?

I have another question, and this one may be a bit off-topic, but I'll run
it up the flagpole.

I want to leave the above-named database open all the time, such that
whenever anybody logs in at the windows login screen, the database will be
up and running. In the actual application there may be as many as twenty
people accessing the same application, and I don't want twenty instances of
the program running -- one for each user. Can I have that database display
on the screen of all users? (Specifically, I would like to use Windows Fast
User Switching to change users.)

In most situations, I could resolve these issues using Access' security
features. This is a unique application, though, and the users won't be able
to log into the database themselves.

Thanks!

Mike

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
14043
by: john_williams_800 | last post by:
Hi; I am writing an html page that will live on one server in an ms windows network, but access pictures from a directory on another ms windows server in the network. I know in html the values for img src use unix style path separators with root ( "/" being your parent web directory. However in windows land the path to my images would be something like
0
1318
by: Juan Manuel G?mez Ramos | last post by:
Hello: I'm using a C# component to manage windows tasks. It allows task creation providing an account name and password. The operating system will only execute the task if the account information for the task is complete and correct (the user exists and its password is provided). It's quite easy to programmaticaly get the current user's name for the account executing the application; but, how do some applications (such as Norton System...
4
3124
by: Mark | last post by:
hey, i'm trying to get the current windows user and the groups they are in. Intergrated windows auth on and annoymous access turned off on IIS. However when trying to compile the following code VS.net doesn't like the User.IsInRole("domain"); With the error "type or namspace for User not found". I can't work out which reference i'm missing! Basically the idea is to create a auth component that is called for
4
5970
by: Nick | last post by:
I'm developing an intranet app, and want to get the current user name for logging purposes. I've turned off anonymous access, and turned on windows authentication in the IIS config. The apps web.config file has authentication mode set to windows, and 'identity impersonate' is set to true. When I try and get the default.aspx page, IE returns an error page with an 'Access is denied.' error. (Even if I try direct from the webserver, logged...
2
2417
by: Scott M. Lyon | last post by:
I'm having some strange problems with a VB.NET application that I support. The application currently uses SystemInformation.UserName() and SystemInformation.UserDomainName() to determine who is logged in, and what network domain they are logged into. And for our environment here (logged into a domain), it seems to work just fine.
13
39235
by: Steve Enzer | last post by:
How can I get the login name of the user currently logged into Windows as a string? Thanks, Steve Enzer
1
2425
by: iwdu15 | last post by:
hi, how can i get the icon associated with a certain file type? thanks -- -iwdu15
4
5686
by: shashank kadge | last post by:
hi all, i am trying to get local admin users and groups on a windows server. here is the C# code that i am using *************************************************************************************************** DirectoryEntry AD = new DirectoryEntry("WinNT://" + sServerName + ",Computer",UserName,Password); DirectoryEntry admGroup = AD.Children.Find("Administrators", "Group"); object members = admGroup.Invoke("Members", null); ...
0
1552
by: TG | last post by:
Hi! Once again I have hit a brick wall here. I have a combobox in which the user types the server name and then clicks on button 'CONNECT' to populate the next combobox which contains all the databases in that server. Then after the user selects a database, I have another button that he/she click and I want to retrieve file groups from a specific table. At this point when he/she clicks on that button I get an error:
0
8671
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4613
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2321
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.