473,804 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1782
"Omey Samaroo" <no****@replyto group.com> wrote in message news:<rf******* ************@ne ws01.bloor.is.n et.cable.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********@hot mail.com> wrote in message
news:bf******** *************** ***@posting.goo gle.com...
"Omey Samaroo" <no****@replyto group.com> wrote in message

news:<rf******* ************@ne ws01.bloor.is.n et.cable.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.*******@worl dnet.att.net.in valid> wrote in message
news:3p******** *************** *********@4ax.c om...

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****@replyto group.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********@hot mail.com> wrote in message
news:bf******* *************** ****@posting.go ogle.com...
"Omey Samaroo" <no****@replyto group.com> wrote in message

news:<rf****** *************@n ews01.bloor.is. net.cable.roger s.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****@replyto group.com> wrote in message news:<_M******* *************@n ews04.bloor.is. net.cable.roger s.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.execu te
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********@hot mail.com> wrote in message
news:bf******** *************** **@posting.goog le.com...
"Omey Samaroo" <no****@replyto group.com> wrote in message

news:<_M******* *************@n ews04.bloor.is. net.cable.roger s.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.execu te
strsql... (if you build the insert string on the fly.

Nov 12 '05 #6
"Omey Samaroo" <no****@replyto group.com> wrote in message news:<N6******* **************@ twister01.bloor .is.net.cable.r ogers.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 IdleTimeDetecte d (ExpiredMinutes )
Application.Qui t acSaveYes
End Sub

You'd just tweak this...

Sub IdleTimeDetecte d (ExpiredMinutes )
'See below for code...

Call LogKickOut
Application.Qui t 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.d ll" Alias _
"GetUserNam eA" (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$(strUserNa me, 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 apiGetComputerN ame Lib "kernel32" Alias _
"GetComputerNam eA" (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 = apiGetComputerN ame(strCompName , lngLen)
If lngX <> 0 Then
fOSMachineName = Left$(strCompNa me, 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********@hot mail.com> wrote in message
news:bf******** *************** ***@posting.goo gle.com...
"Omey Samaroo" <no****@replyto group.com> wrote in message

news:<N6******* **************@ twister01.bloor .is.net.cable.r ogers.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 IdleTimeDetecte d (ExpiredMinutes )
Application.Qui t acSaveYes
End Sub

You'd just tweak this...

Sub IdleTimeDetecte d (ExpiredMinutes )
'See below for code...

Call LogKickOut
Application.Qui t 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.d ll" Alias _
"GetUserNam eA" (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$(strUserNa me, 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****@replyto group.com> wrote in message news:<bT******* ***********@new s02.bloor.is.ne t.cable.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 IdleTimeDetecte d (ExpiredMinutes )
'See below for code...

Call LogKickOuts '<----------THIS LOGS THE KICKOUT.
Application.Qui t 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
11238
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 only one column: txtOutput I want to use the DB front end (MS Access) to send the text string to the SQL backend, then have the SQL Server create a file to a path, such as F:/myfiledate.txt that holds the text in txtOutput, then the trigger...
7
8876
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 want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
4
3269
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 Table Queries and Indexing via SQL. For example ...
3
2668
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. 1>Compiling... 1>Project : error PRJ0003 : Error spawning '/Ox'. _______________________________________ I've checked the attributes, but when I do a "windows properties" it comes up showing the directory with a greyed out "checked" button for "read only"
0
9593
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
10595
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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...
0
10088
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
9169
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...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
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
5529
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
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.