473,395 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

might be a little over the ability of access but can I get user name from system?

yes I tried DBEngine.Workspaces(0).UserName
and this gives me a name of the current user of access.
admin in my case

but can I get the user login name and store it in a table?
the login name of the computer that is

thank you for any help with this
we have a bunch of databases going out on laptops..
multi site info gathering with multi users at each site
we need to know who opened acces and put in what.
Nope they refuse to "WASTE" time putting in a recorderID
we try to explain these things to them but to no avail.

thank you again for any help

ps I went to ms and their listings show
http://support.microsoft.com/default...B;en-us;198755
how to do this same thing in access2k but it gives the same results
computer_name login_name ??
littlecomputer admin

login_name is blank

Jerry
Nov 12 '05 #1
3 2460
sparks <sp****@here.com> wrote in news:6j3lrvgoopte3h8f0a4db6e9kuo5pjcbuo@
4ax.com:
but can I get the user login name and store it in a table?
the login name of the computer that is


Maybe this, but I'm not 100% sure what you want:

Option Explicit

Private Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" _
(ByVal lpBuffer As String, _
nSize As Long) As Long

Private Sub TestUserName()
MsgBox UserName
End Sub

Public Function UserName() As String
Dim BufferLength As Long
Dim Buffer As String
GetUserName Buffer, BufferLength
Buffer = String(BufferLength, " ")
GetUserName Buffer, BufferLength
UserName = Left(Buffer, BufferLength - 1)
End Function

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #2
TC
As Lyle said, use the windows GetUserName function to return the logon-name
of the person currently logged-on to the PC. Add a field to the your
database table, for storing that. Have the BeforeUpdate event of your form,
copy the logon-name (which it gets by calling GetUserName) into that field.
Voila: the logon name of the first person to create the record, or the last
person to alter it, will be stored in the record.

Of course, that won't help with >deletions< ...

HTH,
TC
"sparks" <sp****@here.com> wrote in message
news:6j********************************@4ax.com...
yes I tried DBEngine.Workspaces(0).UserName
and this gives me a name of the current user of access.
admin in my case

but can I get the user login name and store it in a table?
the login name of the computer that is

thank you for any help with this
we have a bunch of databases going out on laptops..
multi site info gathering with multi users at each site
we need to know who opened acces and put in what.
Nope they refuse to "WASTE" time putting in a recorderID
we try to explain these things to them but to no avail.

thank you again for any help

ps I went to ms and their listings show
http://support.microsoft.com/default...B;en-us;198755
how to do this same thing in access2k but it gives the same results
computer_name login_name ??
littlecomputer admin

login_name is blank

Jerry

Nov 12 '05 #3
Thank you very much for all your help.
Now that it does this " OH NO not that lets try " ROFL
thanks again for your help

jerry
On Wed, 19 Nov 2003 14:00:32 +1200, "TC" <a@b.c.d> wrote:
As Lyle said, use the windows GetUserName function to return the logon-name
of the person currently logged-on to the PC. Add a field to the your
database table, for storing that. Have the BeforeUpdate event of your form,
copy the logon-name (which it gets by calling GetUserName) into that field.
Voila: the logon name of the first person to create the record, or the last
person to alter it, will be stored in the record.

Of course, that won't help with >deletions< ...

HTH,
TC
"sparks" <sp****@here.com> wrote in message
news:6j********************************@4ax.com.. .
yes I tried DBEngine.Workspaces(0).UserName
and this gives me a name of the current user of access.
admin in my case

but can I get the user login name and store it in a table?
the login name of the computer that is

thank you for any help with this
we have a bunch of databases going out on laptops..
multi site info gathering with multi users at each site
we need to know who opened acces and put in what.
Nope they refuse to "WASTE" time putting in a recorderID
we try to explain these things to them but to no avail.

thank you again for any help

ps I went to ms and their listings show
http://support.microsoft.com/default...B;en-us;198755
how to do this same thing in access2k but it gives the same results
computer_name login_name ??
littlecomputer admin

login_name is blank

Jerry


Nov 12 '05 #4

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

Similar topics

6
by: moonriver | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004...
4
by: Jim Hubbard | last post by:
I have some C# code that is supposed to wrap the defrag APIs and I am trying to convert it to VB.Net (2003). But, I keep having problems. The C# code is relatively short, so I'll post it...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
16
by: Rob Geraghty | last post by:
I've just spent some time looking through FAQ sites and searching the google archives of this newsgroup, but I still haven't been able to find a clear explanation of an issue with multi-user...
2
by: MyNameIsnt | last post by:
Can anyone tell me why, when I click on the buttons it register 2 characters on the display? if you use the right mousebutton it works ok, but the buttons dont flash?? it works fine without the...
1
by: cpajoe2001 | last post by:
I am having an issue and after searching around online for a day and half now and finding others with the same problem but yet no solution to my issue I am looking for help. What i have is ServerA...
0
by: M1Sports20 | last post by:
Here is a class i have expanded off of microsoft picturebox array in msdn. I have found a problem and I am thinking its not my fault. Here is how to reproduce the error 1. Create an instance of...
8
by: Jeremy Ames | last post by:
I am trying to move an application from my system to a new test system. I really should have tried an easier program first, but I didn't really have a chance. My application was originally written in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.