473,799 Members | 2,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Log user on opening

I have a database that is using an audit table that logs the machine and
user to each record change. My problem is that more than 1 user uses the
same login, (this will not change!) hence the audit trail is valueless whn
trying to identify an individual.
I need a login form that will validate a user against a stored table of
passwords and then add that username to any audited entries made during that
session.
Any ideas to solve this are most welcome.

Thanks
Diverdon
Nov 12 '05 #1
9 1731
snag their NT login name and box name to determine who is who

John Bickmore
www.BicycleCam.com
www.Feed-Zone.com

"diverdon99 " <di********@yah oo.co.uk> wrote in message
news:br******** **@hercules.bti nternet.com...
I have a database that is using an audit table that logs the machine and
user to each record change. My problem is that more than 1 user uses the
same login, (this will not change!) hence the audit trail is valueless whn
trying to identify an individual.
I need a login form that will validate a user against a stored table of
passwords and then add that username to any audited entries made during that session.
Any ideas to solve this are most welcome.

Thanks
Diverdon

Nov 12 '05 #2

"xzzy" <mr********@com cast.net> wrote in message
news:wVvCb.5273 26$Tr4.1453524@ attbi_s03...
snag their NT login name and box name to determine who is who

John Bickmore
www.BicycleCam.com
www.Feed-Zone.com


How is that done? Can you give a code example?

-- Betty "Boop" Martin
Nov 12 '05 #3
Hi Betty:

Here is how I do it. It works for me. Your mileage may vary.

First, create a global variable name, g_strUserName, to hold the network
name value that you will use in multiple places in your code. Then, use the
following function, which I got from http://www.mvps.org/access/

Function GetUserName() As String

Dim ret As Long
Dim cbusername As Long

g_strUserName = ""
g_strUserName = Space(256)
cbusername = Len(g_strUserNa me)
ret = WNetGetUser(ByV al 0&, g_strUserName, cbusername)

If ret = 0 Then ' Success - strip off the null.
g_strUserName = Left(g_strUserN ame, InStr(g_strUser Name, Chr(0)) - 1)
Else
g_strUserName = ""
End If

GetUserName = g_strUserName

End Function

Note that, in order for this to work, you must put:

Declare Function WNetGetUser& Lib "Mpr" Alias "WNetGetUse rA" (lpName As Any,
ByVal pUserName$, pnLength&)

at the top of your module.

Good luck.

Alan
Nov 12 '05 #4
Thats how I get the 'alleged' logged on use, but the problem is that a
number of people use the same NT logon. I need to record the actual user
after them logon through a user form or similar and write this name into a
transaction (audit) file.
We have a policy that only staff members can have a logon and as is common
we have a lot of temps that need to be logged on. Thats how duplicate NT
(User) logons happen.

Diverdon

"Alan Lane" <aw*****@nether e.com> wrote in message
news:s7******** ********@twiste r.socal.rr.com. ..
Hi Betty:

Here is how I do it. It works for me. Your mileage may vary.

First, create a global variable name, g_strUserName, to hold the network
name value that you will use in multiple places in your code. Then, use the following function, which I got from http://www.mvps.org/access/

Function GetUserName() As String

Dim ret As Long
Dim cbusername As Long

g_strUserName = ""
g_strUserName = Space(256)
cbusername = Len(g_strUserNa me)
ret = WNetGetUser(ByV al 0&, g_strUserName, cbusername)

If ret = 0 Then ' Success - strip off the null.
g_strUserName = Left(g_strUserN ame, InStr(g_strUser Name, Chr(0)) - 1) Else
g_strUserName = ""
End If

GetUserName = g_strUserName

End Function

Note that, in order for this to work, you must put:

Declare Function WNetGetUser& Lib "Mpr" Alias "WNetGetUse rA" (lpName As Any, ByVal pUserName$, pnLength&)

at the top of your module.

Good luck.

Alan

Nov 12 '05 #5
"diverdon99 " <di********@yah oo.co.uk> wrote in message
news:br******** **@titan.btinte rnet.com...
Thats how I get the 'alleged' logged on use, but the problem is that a
number of people use the same NT logon. I need to record the actual user
after them logon through a user form or similar and write this name into a
transaction (audit) file.


That's easy. Use Windows NT users and groups properly. If you can't be
bothered to do that then just used Access security. I assume that this is
all about using an Access database.
Nov 12 '05 #6

"Alan Lane" <aw*****@nether e.com> wrote in message
news:s7******** ********@twiste r.socal.rr.com. ..
Hi Betty:

Here is how I do it. It works for me. Your mileage may vary.

First, create a global variable name, g_strUserName, to hold the network
name value that you will use in multiple places in your code. Then, use the following function, which I got from http://www.mvps.org/access/

Function GetUserName() As String

Dim ret As Long
Dim cbusername As Long

g_strUserName = ""
g_strUserName = Space(256)
cbusername = Len(g_strUserNa me)
ret = WNetGetUser(ByV al 0&, g_strUserName, cbusername)

If ret = 0 Then ' Success - strip off the null.
g_strUserName = Left(g_strUserN ame, InStr(g_strUser Name, Chr(0)) - 1) Else
g_strUserName = ""
End If

GetUserName = g_strUserName

End Function

Note that, in order for this to work, you must put:

Declare Function WNetGetUser& Lib "Mpr" Alias "WNetGetUse rA" (lpName As Any, ByVal pUserName$, pnLength&)

at the top of your module.

Good luck.

Alan

Thanks, Alan!

Nov 12 '05 #7
Mike,

Can you explain a little further on NT Users and Groups property, I must be
missing something obvious here.
All the reading on Access security has suggested that it is a last resort as
it is difficult to set up and the risk of locking yourself out is high.

Here is the code that I use to get the logon and more than 1 person can
logon under the same name, therefore the audit trail has not identified the
individual person but rather the logged in person. This is why I thought
the route to go would be to have the user select their name from a dialog or
form then store this in a global variable and write this to the audit table
on an event change.
Whilst I thought this is the way to go, I am short on the knowledge for
implementation.
'Code Start *************** ****
Option Explicit

Private Const conMod As String = "ajbAudit"
Declare Function wu_GetUserName Lib "advapi32" Alias "GetUserNam eA" (ByVal
lpBuffer As String, nSize As Long) As Long

Function NetworkUserName () As String
Dim lngStringLength As Long
Dim sString As String * 255

lngStringLength = Len(sString)
sString = String$(lngStri ngLength, 0)

If wu_GetUserName( sString, lngStringLength ) Then
NetworkUserName = Left$(sString, lngStringLength )
Else
NetworkUserName = "Unknown"
End If
End Function

Diverdon
"Mike MacSween" <mi************ ******@btintern et.com> wrote in message
news:3f******** *************** @news.aaisp.net .uk...
"diverdon99 " <di********@yah oo.co.uk> wrote in message
news:br******** **@titan.btinte rnet.com...
Thats how I get the 'alleged' logged on use, but the problem is that a
number of people use the same NT logon. I need to record the actual user after them logon through a user form or similar and write this name into a transaction (audit) file.


That's easy. Use Windows NT users and groups properly. If you can't be
bothered to do that then just used Access security. I assume that this is
all about using an Access database.

Nov 12 '05 #8
"diverdon99 " <di********@yah oo.co.uk> wrote in message
news:br******** **@sparta.btint ernet.com...
Mike,

Can you explain a little further on NT Users and Groups property, I must be missing something obvious here.


What I meant was that if you're using a shared NT logon then you have 2
choices:

1. Stop. And use NT logons for what they're meant for - i.e. robust
security, giving users/groups access to certain resources, denying them
access to other resources and so on. Why are your temps sharing a log on?
Because nobody has the NT knowledge to create new users? That isn't very
difficult knowledge to gain, and somebody in your organisation ought to have
it.

2. Carry on with your shared NT logon (which I think is a bad idea). And use
another method to track the 'real' user. And I can't see any point in
writing your own system when MS have done it for you - Access users and
groups:

http://support.microsoft.com/default...ent/secfaq.asp

I've just set up security for the first time. Wasn't that hard. A few blips
along the way.

Mike
Nov 12 '05 #9
"diverdon99 " <di********@yah oo.co.uk> wrote:
We have a policy that only staff members can have a logon and as is common
we have a lot of temps that need to be logged on. Thats how duplicate NT
(User) logons happen.


Like Mike states that policy of not granting logons to temps is stupid, shortsighted
as doesn't allow for any accountability as to what temp did what.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #10

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

Similar topics

7
5827
by: Fuzzyman | last post by:
I'm writing a function that will query the comp.lang.python newsgroup via google groups....... (I haven't got nntp access from work..) I'm using urllib (for the first time)..... and google don't seem very keen to let me search the group from within a program - the returned pages all tell me 'you're not allowed to do that' :-) I read in the urllib manual pages : class URLopener( ])
9
3133
by: Leo Breebaart | last post by:
I am writing a utility in Python and I'd like to add a command-line option "--mailto <address>" that will cause an e-mail summary to be sent to <address> when the utility finishes running. My first thought was to use smtplib.sendmail(), and basically this works like a charm, except that this function expects a valid 'sender' address as a parameter. Every single smtplib example I've found so far shows a hardcoded
0
1658
by: Rea Peleg | last post by:
link to configuration file prevents user control download to internet explorer Hi I have a simple web application which consists an opening html page with a (windows form user) control which on click event should download an assembley from the server site to client ie. Opening page displays correctly with control when it does not include the
5
6603
by: Chris | last post by:
Hi everyone, I have an error message in an Access 97 database & I was hoping someone may be able to help me get rid of it (bearing in mind I only have an average understanding of Access & absolutely none of VB coding). Originally, this database was in Access 2003 format. I opened it in 2003, then used the convert option to back it down to Access 97. I then opened it in 97. Upon opening, I get this error message: "compile error:...
12
5762
by: Paul H | last post by:
Say I have a Windows 2000 server running Terminal Services with a single file Access DB (not front end/back end) on it, could multiple users access the data base simultaneously? Paul
2
1272
by: Ryan Riddell | last post by:
I have a repeater where I output user comments (255 char limit). I want to give the user the ability to add <i>italic</i> and <b>bold</b> font using standard HTML tags. I changed the repeater to have a label with id=RepeaterCommentText. I then registered the ItemDataBound event to be handled by CommentBound (which has the appropriate parameters). On Comment Entry I change the tags to have square braces (ex. "<b>" to ""). In CommentBind I...
5
2075
by: Michelle Stone | last post by:
Hi everybody I am writing a simple asp.net application using form authentication. I store the list of all users and their passwords in an SQL Server database table. My client recently told me that he wants me to do something through which only one user can login using any given account name. I mean to say, for example, when a user called "abc" is online, another person shouldn't be
1
2510
by: DoctorV3774 | last post by:
I need a function to do the following when opening a Form named NewFrm_MainTemplate. I need the function to look at the user id of the person attempting to open the form. Their Windows user ID will be in a Table we have named Tbl_Employee-----Field name is Employee_Win_User_ID Also in the Table is a Filed named Main_Form_Rights This field contains 2 Values Administrator or View Only What I need is to match the users Windows ID...
4
1857
by: PraveenKadkol | last post by:
Hi, My Development is in almost final stages, now i am facing problem with the reports. I am generating MsAccess Reports based on the selected Parameters, while generating Report I am opening reports forms in desgin mode and then i am passing Parameters and Sql String to Record Source This is working ifne for single user, but if multi users generate then i am facing problem. If i am not opening the report is desgin mode then I...
2
4826
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be required: <%@ Register TagPrefix="UC" TagName="MyUserCtrl" Src="MyUC.ascx" %> Assuming that the ASPX page doesn't use a code-behind, I can access the properties, events etc. of the user control in the ASPX page in this way (assume that the ASPX page...
0
9688
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
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10247
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10031
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
9079
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
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.