473,394 Members | 1,821 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,394 software developers and data experts.

How do I create a table to log users that the application has booted out

I have had most of my questions answered in this forum and learned a lot
from reading others post. In fact, I have even discovered answers to
questions that I thought were totally impossible and absurd to ask, and for
that I will continue to be a fan to this NG.

Today I have one question (two parts): How do I create a table to log users
that the application has booted out ? Does it log the users by computer name
?

Thanks very much.

Omey
Nov 12 '05 #1
8 1764
"Omey Samaroo" <no****@replytogroup.com> wrote in message news:<rf*******************@news01.bloor.is.net.ca ble.rogers.com>...
I have had most of my questions answered in this forum and learned a lot
from reading others post. In fact, I have even discovered answers to
questions that I thought were totally impossible and absurd to ask, and for
that I will continue to be a fan to this NG.

Today I have one question (two parts): How do I create a table to log users
that the application has booted out ? Does it log the users by computer name
?

Thanks very much.

Omey

Define "booted out". Without understanding what that means, I'm not
sure anyone can answer your question.
Nov 12 '05 #2
Thanks for pointing that out, Pieter
Okay, I now use a hidden form with a timer control to close the database if
a user is inactive for 10 minutes (learned at this forum)
What I would like to do next is find out which users were closed by this
method and store the info in a table. Is this at all possible?
(Hope that I explained it a little better)

"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
"Omey Samaroo" <no****@replytogroup.com> wrote in message

news:<rf*******************@news01.bloor.is.net.ca ble.rogers.com>...
I have had most of my questions answered in this forum and learned a lot
from reading others post. In fact, I have even discovered answers to
questions that I thought were totally impossible and absurd to ask, and for that I will continue to be a fan to this NG.

Today I have one question (two parts): How do I create a table to log users that the application has booted out ? Does it log the users by computer name ?

Thanks very much.

Omey

Define "booted out". Without understanding what that means, I'm not
sure anyone can answer your question.

Nov 12 '05 #3
Thanks for the tip Chuck & Pieter, cheers
"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:3p********************************@4ax.com...

Write to a "log" file somewhere indicating that. See Access Help on
the OPEN statement for more information.

On Fri, 05 Dec 2003 06:42:02 GMT, "Omey Samaroo"
<no****@replytogroup.com> wrote:
Thanks for pointing that out, Pieter
Okay, I now use a hidden form with a timer control to close the database ifa user is inactive for 10 minutes (learned at this forum)
What I would like to do next is find out which users were closed by this
method and store the info in a table. Is this at all possible?
(Hope that I explained it a little better)

"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google. com...
"Omey Samaroo" <no****@replytogroup.com> wrote in message

news:<rf*******************@news01.bloor.is.net.c able.rogers.com>...
> I have had most of my questions answered in this forum and learned a lot > from reading others post. In fact, I have even discovered answers to
> questions that I thought were totally impossible and absurd to ask,
andfor
> that I will continue to be a fan to this NG.
>
> Today I have one question (two parts): How do I create a table to log

users
> that the application has booted out ? Does it log the users by
computername
> ?
>
> Thanks very much.
>
> Omey
Define "booted out". Without understanding what that means, I'm not
sure anyone can answer your question.

--
When You Come To The End Of Your Rope, Tie A Knot In It And Hang On!

Nov 12 '05 #4
"Omey Samaroo" <no****@replytogroup.com> wrote in message news:<_M********************@news04.bloor.is.net.c able.rogers.com>...
Thanks for pointing that out, Pieter
Okay, I now use a hidden form with a timer control to close the database if
a user is inactive for 10 minutes (learned at this forum)
What I would like to do next is find out which users were closed by this
method and store the info in a table. Is this at all possible?
(Hope that I explained it a little better)


Oh, now it makes sense. Sure, before you shut the database, you'd
write the person's userid or whatever to a table, the time they were
kicked out, and a reason. Just open a recordset and add the records
you want and then update.

Username... that's at mvps.org/access (Accessweb).
The time: just use Now()
The reason: from that form, you'd just set it to "Inactive Timeout" or
something and then append the record.

Of course, you could use cnn.Execute strSQL or currentdb.execute
strsql... (if you build the insert string on the fly.
Nov 12 '05 #5
Awesome, thanks for the suggestions Pieter. I will admit that some of it is
a little over my head, but I will do some research and ask more questions if
I get stuck.

Omey

"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf*************************@posting.google.co m...
"Omey Samaroo" <no****@replytogroup.com> wrote in message

news:<_M********************@news04.bloor.is.net.c able.rogers.com>...
Thanks for pointing that out, Pieter
Okay, I now use a hidden form with a timer control to close the database if a user is inactive for 10 minutes (learned at this forum)
What I would like to do next is find out which users were closed by this
method and store the info in a table. Is this at all possible?
(Hope that I explained it a little better)


Oh, now it makes sense. Sure, before you shut the database, you'd
write the person's userid or whatever to a table, the time they were
kicked out, and a reason. Just open a recordset and add the records
you want and then update.

Username... that's at mvps.org/access (Accessweb).
The time: just use Now()
The reason: from that form, you'd just set it to "Inactive Timeout" or
something and then append the record.

Of course, you could use cnn.Execute strSQL or currentdb.execute
strsql... (if you build the insert string on the fly.

Nov 12 '05 #6
"Omey Samaroo" <no****@replytogroup.com> wrote in message news:<N6*********************@twister01.bloor.is.n et.cable.rogers.com>...
Awesome, thanks for the suggestions Pieter. I will admit that some of it is
a little over my head, but I will do some research and ask more questions if
I get stuck.

Omey


Okay, the stuff from MS...
http://support.microsoft.com/default...B;en-us;128814

Sub IdleTimeDetected (ExpiredMinutes)
Application.Quit acSaveYes
End Sub

You'd just tweak this...

Sub IdleTimeDetected (ExpiredMinutes)
'See below for code...

Call LogKickOut
Application.Quit acSaveYes
End Sub

Okay... a "helper" function:
API: Get Login name
Author(s)
Dev Ashish
http://www.mvps.org/access/api/api0008.htm

(Q) How do I retrieve the UserName with which the user is logged into
the network?

(A) Paste the following code in a new module and call the function
fOSUserName.
'******************** Code Start **************************
' This code was originally written by Dev Ashish. ' It is not to be
altered or distributed,' except as part of an application. ' You are
free to use it in any application, ' provided the copyright notice is
left unchanged.'' Code Courtesy of ' Dev Ashish'

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

Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If ( lngX > 0 ) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function
'******************** Code End **************************
Okay, here's the code:

Public Sub LogKickouts()
Dim strSQL As String

strSQL = "INSERT INTO KickedOutUsers ( UserName, Reason ) VALUES
('" & fOSUserName & "', 'Idle Too long');"
DBEngine(0)(0).Execute strSQL

End Sub
Nov 12 '05 #7
Pieter, in this instance I am not using usernames but ComputerNames as all
users share the main database password.
I copied and created a module from Dev
******************** Code Start **************************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Private Declare Function apiGetComputerName Lib "kernel32" Alias _
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSMachineName() As String
'Returns the computername
Dim lngLen As Long, lngX As Long
Dim strCompName As String
lngLen = 16
strCompName = String$(lngLen, 0)
lngX = apiGetComputerName(strCompName, lngLen)
If lngX <> 0 Then
fOSMachineName = Left$(strCompName, lngLen)
Else
fOSMachineName = ""
End If
End Function
'******************** Code End **************************

but now how do I use it to create the table and write the computer name and
date/time that it was closed for inactivity ?

Omey
"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
"Omey Samaroo" <no****@replytogroup.com> wrote in message

news:<N6*********************@twister01.bloor.is.n et.cable.rogers.com>...
Awesome, thanks for the suggestions Pieter. I will admit that some of it is a little over my head, but I will do some research and ask more questions if I get stuck.

Omey


Okay, the stuff from MS...
http://support.microsoft.com/default...B;en-us;128814

Sub IdleTimeDetected (ExpiredMinutes)
Application.Quit acSaveYes
End Sub

You'd just tweak this...

Sub IdleTimeDetected (ExpiredMinutes)
'See below for code...

Call LogKickOut
Application.Quit acSaveYes
End Sub

Okay... a "helper" function:
API: Get Login name
Author(s)
Dev Ashish
http://www.mvps.org/access/api/api0008.htm

(Q) How do I retrieve the UserName with which the user is logged into
the network?

(A) Paste the following code in a new module and call the function
fOSUserName.
'******************** Code Start **************************
' This code was originally written by Dev Ashish. ' It is not to be
altered or distributed,' except as part of an application. ' You are
free to use it in any application, ' provided the copyright notice is
left unchanged.'' Code Courtesy of ' Dev Ashish'

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

Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If ( lngX > 0 ) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function
'******************** Code End **************************
Okay, here's the code:

Public Sub LogKickouts()
Dim strSQL As String

strSQL = "INSERT INTO KickedOutUsers ( UserName, Reason ) VALUES
('" & fOSUserName & "', 'Idle Too long');"
DBEngine(0)(0).Execute strSQL

End Sub

Nov 12 '05 #8
"Omey Samaroo" <no****@replytogroup.com> wrote in message news:<bT******************@news02.bloor.is.net.cab le.rogers.com>...
Pieter, in this instance I am not using usernames but ComputerNames as all
users share the main database password.
but now how do I use it to create the table and write the computer name and
date/time that it was closed for inactivity ?

Omey

Sub IdleTimeDetected (ExpiredMinutes)
'See below for code...

Call LogKickOuts '<----------THIS LOGS THE KICKOUT.
Application.Quit acSaveYes
End Sub

Okay, here's the code:

Public Sub LogKickouts() 'WRITE THE KICKOUT TO THE TABLE. Dim strSQL As String

strSQL = "INSERT INTO KickedOutUsers ( UserName, Reason ) VALUES
('" & fOSUserName & "', 'Idle Too long');"
DBEngine(0)(0).Execute strSQL

End Sub

Nov 12 '05 #9

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

Similar topics

9
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
4
by: Owen Jenkins | last post by:
Hi, No-one replied to this when I sent it last week. Any bites out there today?? ----- My application allows users to create a new back end for separate purposes. It does this by using Make...
3
by: =?Utf-8?B?RGF2ZS1I?= | last post by:
error PRJ0006 : Could not open the temporary file 'c:\Project\CompressMorphis\Release\RSP00000133601984.rsp'. Make sure the file exists and that the directory is not write-protected....
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...
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...

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.