By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,479 Members | 2,260 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,479 IT Pros & Developers. It's quick & easy.

multiple users

P: n/a
ken
Is there a way to check if access has not been used for say 10 minutes
and then to close the front end? I was just thinking that that might be
a good idea since a lot of people like having their frontends alway
open and that is not good...

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ken wrote:
Is there a way to check if access has not been used for say 10 minutes
and then to close the front end? I was just thinking that that might
be a good idea since a lot of people like having their frontends alway
open and that is not good...


It can be done, but it's not trivial because there is no built in method for
detecting "idle time". You could have a hidden form with a Timer event and
when certain events happen you could reset that Timer. The problem is you
would have to reset that Timer in EVERY possible event to be able to tell if
the user was not doing anything.

If you are satisfied with only resetting the timer on fewer more significant
events (opening a form or report, saving a record, etc.), then it becomes
more practical, but you also run the risk of closing the app when the user
is really doing something that you were not monitoring.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
ken
ok what about...the posibility of one front end finding out who is
using the record that they are on...or maybe a way to identify in front
ends who is using the database?

Nov 13 '05 #3

P: n/a
Br
ken <ge****@gmail.com> wrote:
ok what about...the posibility of one front end finding out who is
using the record that they are on...or maybe a way to identify in
front ends who is using the database?


This code builds a list of computer names that are currently connected
to the backend. Users of a system I use this in can still have the
program open at the first switchboard as there is no data access at that
time.

On Error GoTo GetCurrentUsers_err
Dim cn As New ADODB.Connection
Dim cn2 As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i, j As Long, ds As String
Dim ComputerName As Variant, UserName As Variant
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM appCurrentUsers;"
DoCmd.SetWarnings True
ds = GetDataLocation() ' a function a returns the path to the backend
database
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=" & ds
'cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & ds
Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
Dim rsOut As DAO.Recordset
Set rsOut = CurrentDb.OpenRecordset("appCurrentUsers",
DB_OPEN_DYNASET)
With rsOut
While Not rs.EOF
UserName = Trim(rs.Fields(1))
UserName = Left(UserName, Len(UserName) - 1)
ComputerName = Trim(rs.Fields(0))
ComputerName = Left(ComputerName, Len(ComputerName) - 1)
.AddNew
If UserName = "Admin" Then
![UserName] = CurrentUser
![Computer] = ComputerName & " (local)"
Else
![UserName] = UserName
![Computer] = ComputerName
End If
![Connected] = rs.Fields(2)
![SuspectState] = rs.Fields(3)
.Update
rs.MoveNext
Wend
End With

--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #4

P: n/a
Br
ken <ge****@gmail.com> wrote:
ok what about...the posibility of one front end finding out who is
using the record that they are on...or maybe a way to identify in
front ends who is using the database?


This code builds a list of computer names that are currently connected
to the backend. Users of a system I use this in can still have the
program open at the first switchboard as there is no data access at that
time.

On Error GoTo GetCurrentUsers_err
Dim cn As New ADODB.Connection
Dim cn2 As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i, j As Long, ds As String
Dim ComputerName As Variant, UserName As Variant
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM appCurrentUsers;"
DoCmd.SetWarnings True
ds = GetDataLocation() ' a function a returns the path to the backend
database
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=" & ds
'cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & ds
Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
Dim rsOut As DAO.Recordset
Set rsOut = CurrentDb.OpenRecordset("appCurrentUsers",
DB_OPEN_DYNASET)
With rsOut
While Not rs.EOF
UserName = Trim(rs.Fields(1))
UserName = Left(UserName, Len(UserName) - 1)
ComputerName = Trim(rs.Fields(0))
ComputerName = Left(ComputerName, Len(ComputerName) - 1)
.AddNew
If UserName = "Admin" Then
![UserName] = CurrentUser
![Computer] = ComputerName & " (local)"
Else
![UserName] = UserName
![Computer] = ComputerName
End If
![Connected] = rs.Fields(2)
![SuspectState] = rs.Fields(3)
.Update
rs.MoveNext
Wend
End With

--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.