Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Access 2 - users,......(Help me please someone)

16 views
Skip to first unread message

Nicholas Cohen

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to
Hello all potential helping-type-people!!!!!

I have developed a multi-user app using Access 2.

However I am trying to create a form that displays all the users that are
logged into the communal system database and not having much luck. I
sometimes need to open the database exclusively for maintenence, and cannot
identify which of the thirty odd users are logged on (so I can call them &
tell them to get out)

Can this be done - I think not - but would be very pleasantly surprised if
someone could prove me wrong!

I look forward to hearing from you!!

Regards

Nicholas Cohen

Richard Hayward

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to
On Thu, 12 Nov 1998 20:58:27 -0800, "Nicholas Cohen"

>However I am trying to create a form that displays all the users that are
>logged into the communal system database and not having much luck. I
>sometimes need to open the database exclusively for maintenence, and cannot
>identify which of the thirty odd users are logged on (so I can call them &
>tell them to get out)
>

Hi Nicholas,

I do this by having a current_connections table in the back end. As
each user starts up, the front end writes thier name to this table,
using the currentuser() function, together with the login time.

On exit the front end locates the appropriate row in the table and
deletes it.

This still does not tell me the location from where they log in
however. You could have a line in a local ini file to do this if
needed.

regards
Richard
ric...@tortoise.demon.co.uk

Arvin Meyer

unread,
Nov 12, 1998, 3:00:00 AM11/12/98
to
Yes its possible, if you are a network admin, you can check to see whos
logged into an app in User Manager on NT, or using PConsole on Novell. You
can also use this function I picked up and altered to run on Access 2.0:

Create a new module. In the declarations section of the module enter the
following:

Option Compare Database 'Use database order for string comparisons

Type UserRec
bMach(1 To 32) As String * 1 ' 1st 32 bytes hold machine name
bUser(1 To 32) As String * 1 ' 2nd 32 bytes hold user name
End Type

Then put the following code in a standard module
'---------------------------------------------------------------------------
----------
Function WhosOn () As String
' Subject : WhosOn()
' Purpose : Will read *.LDB file and read who's currently logged on.
' LDB files have a 32 byte starter & trailer.
' Log-in names start at 33rd byte and then every 64th
thereafter.

On Error GoTo Err_WhosOn

Dim iLDBFile As Integer, iStart As Integer
Dim iLOF As Integer, i As Integer
Dim sPath As String, x As String
Dim sLogStr As String, sLogins As String
Dim sMach As String, sUser As String
Dim rUser As UserRec ' Defined in General
Dim dbCurrent As Database

' Get Path of current database. Should substitute this code
' for an attached table path in a multi-user environment.

Set dbCurrent = DBEngine.Workspaces(0).Databases(0)
sPath = dbCurrent.Name
dbCurrent.Close

' Iterate thru dbCurrent.LDB file for login names.

sPath = Left(sPath, InStr(1, sPath, ".")) + "LDB"

' Test for valid file, else Error

x = Dir(sPath)
iStart = 1
iLDBFile = FreeFile

Open sPath For Binary Access Read Shared As iLDBFile
iLOF = LOF(iLDBFile)
Do While Not EOF(iLDBFile)
Get iLDBFile, , rUser
i = 1
sMach = ""
While rUser.bMach(i) <> Chr$(32) And rUser.bMach(i) <> Chr(0)
sMach = sMach & rUser.bMach(i)
i = i + 1
Wend
i = 1
sUser = ""
While rUser.bUser(i) <> Chr$(32) And rUser.bUser(i) <> Chr(0)
sUser = sUser & rUser.bUser(i)
i = i + 1
Wend
sLogStr = sMach & " -- " & sUser
If InStr(sLogins, sLogStr) = 0 Then
sLogins = sLogins & sLogStr & ";"
End If
iStart = iStart + 64 'increment to next record offset
If iLOF <= (iStart + 64) Then Exit Do
Loop
Close iLDBFile
WhosOn = sLogins

Exit_WhosOn:
Exit Function

Err_WhosOn:
If Err = 68 Then
MsgBox "Couldn't populate the list", 48, "No LDB File"
Else
MsgBox "Error: " & Err & Chr(13) & Chr(10) & Error$
Close iLDBFile
End If
Resume Exit_WhosOn
End Function


Typing: ?WhosOn()
in the debug window will give you the computername and username of each
logged on user. If your database isn't secured, all users will be admin, but
you'll still have their computer names.
-----
Arvin Meyer
ons...@esinet.net


Nicholas Cohen wrote in message
<910904343.9839.0...@news.demon.co.uk>...


>Hello all potential helping-type-people!!!!!
>
>I have developed a multi-user app using Access 2.
>

>However I am trying to create a form that displays all the users that are
>logged into the communal system database and not having much luck. I
>sometimes need to open the database exclusively for maintenence, and cannot
>identify which of the thirty odd users are logged on (so I can call them &
>tell them to get out)
>

HaHa

unread,
Nov 13, 1998, 3:00:00 AM11/13/98
to
On the Access Developer part of Microsoft, there is a tool that gives some
insight to the people that are using certain databases. Check on:
www.microsoft.com/accessdev

Good luck

Nicholas Cohen <n...@fluffnfur.demon.co.uk> wrote in article

Jay Holovacs

unread,
Nov 13, 1998, 3:00:00 AM11/13/98
to

> However I am trying to create a form that displays all the users that are
> logged into the communal system database and not having much luck.

It would be a triumph of artificial intelligence if we could identify which
users are not having much luck! Especially usefull for online gamblers.
;-)

(...sorry, couldn't help it...)


Jay

Mary Maclean

unread,
Nov 13, 1998, 3:00:00 AM11/13/98
to
There's also a little application called LDBVIEW which shows you who's
on, and which user may have corrupted the database. You can switch
around from mdb to another. Search the Microsoft site for it. The latest
version works for all 3 versions of Access.

Nicholas Cohen wrote:
>
> Hello all potential helping-type-people!!!!!
>
> I have developed a multi-user app using Access 2.
>

> However I am trying to create a form that displays all the users that are

> logged into the communal system database and not having much luck. I
> sometimes need to open the database exclusively for maintenence, and cannot
> identify which of the thirty odd users are logged on (so I can call them &
> tell them to get out)
>
> Can this be done - I think not - but would be very pleasantly surprised if
> someone could prove me wrong!
>
> I look forward to hearing from you!!
>
> Regards
>
> Nicholas Cohen

--
================================================
Mary Maclean mmac...@brenrose.com
================================================

0 new messages