How To Determine Who Is Logged On My Database?

Oct 30, 2006

Hi,
I have a sub, which shows in the Intermediate window who is currently logged to the database. This is my code:

Sub ShowUserRosterMultipleUsers()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i, j As Long

Set cn = CurrentProject.Connection

' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4.0 OLE DB provider. You have to use a GUID to
' reference the schema, as provider-specific schemas are not
' listed in ADO's type library for schema rowsets

Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

'Output the list of all users in the current database.

Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
"", rs.Fields(2).Name, rs.Fields(3).Name

While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), _
rs.Fields(2), rs.Fields(3)
rs.MoveNext
Wend

End Sub

Now I want to provide this information in a table or other kind of output, when the administrative user presses a button on a form.

What do I have to do with that code? :confused:

Can Anybody help me with that? :)

Thanks in advance...

View Replies


ADVERTISEMENT

Reports :: Show Currently Logged In User Into Database?

Jan 23, 2015

How do I run a report that will show me who is currently logged into my database that is saved on the server.

View 1 Replies View Related

Forms :: Show Users Logged In To Database

May 3, 2015

I would like to create a form that will show the users connected to the database. It would be kind of a tracker who opened the database to work on some cases. The form could show all users from the datbase from top to bottom and to the right a green or red round dot that she/he is active opened the database or not active (closed the database or did not open it still)

I was thinking that it could be applied when the main form opens and that form captures the login from windows into the "tracker" form.

I guess it will only work when the "tracker" form is first open. If the "tracker" form is open later, how to capture those logged in earlier?

View 14 Replies View Related

Modules & VBA :: Determine File Format Without Opening Database (Using Access 2007)

Jul 15, 2014

Using Access 2007, can I return a value for CurrentProject.FileFormat WITHOUT opening the database?

I'm looking for a way to determine the file version of a given Access database without actually "opening" the database in Access (I don't want it to ever be visible at all or in any way).

So to open a database in Access 2007 "without opening it," I'm using:

Code:
Dim db As DAO.Database
Set db = DBEngine.Workspaces(0).OpenDatabase("C:Path-ToFile.accdb")

From here, there are at least two different "version" indicators that can be used, as in this example:

Code:
Debug.Print db.Properties("Version").Value
Debug.Print db.Properties("AccessVersion").Value

Now, if you run this code on an Access 2002/2003 .MDB file, you will get:

Code:
4.0
09.50

If you run this code on an Access 2007 .ACCDB file, you get:

Code:
12.0
09.50

Note two important factors:The db.Properties("Version") seems to be returning the JET version from what I can see in research. This is NOT what I'm after.

The db.Properties("AccessVersion") returns THE SAME VALUE for an '07 ACCDB as it does for an '02-'03 MDB, since Microsoft never updated it, apparently.

Now.... the one way that I have found that ACCURATELY describes the version of a given access database file is to use:

Code:
Debug.Print CurrentProject.FileFormat

...as this will always return, for example, 2.0 for an Access 2.0 .MDB file; 10 for an Access 2002/03 .MDB file; and 12 for and Access 2007 .ACCDB file (and there are others; these are AcFileFormat bitmask constants as described in Access support).

BUT, this CurrentProject object doesn't seem to be available (so far as I can see) when using the "open without opening" method described above.

SO, is there any way to return the FileFormat value without opening the database visibly? (Merely basing it in the extension isn't right either.... that would be easy but not accurate as several formats use MDB.

View 5 Replies View Related

Need Help With Logged On User

Oct 28, 2005

Hi,

I found this database with an LOGIN sample.
This is working perfectly...(see example)

Now I want to accomplish this:

Based on the user that is logged in I want to generate reports.
Is there a way to recall the username or userID and link that to specific reports...

Allso I want to add an mail adress field in the userstable and based on the logged in user I want to hit a mail button and it will check the logged in user...
and mail the report to that specific user...

Can someone help me?

Thanks,

View 3 Replies View Related

User Logged

Feb 7, 2006

HY everyone!

I used the following script "GetCurrentUserName()" in access 2003 to get the username of the logged user. I’m using the following script "CurrentUser()" in access 97 but it always recognise any user as a admin.
Is there anyone that could tell me how to solve this please?
Thanks

View 1 Replies View Related

User Who Just Logged In

Aug 31, 2006

In an network environment that requires users to log in, is there any way for Access to record a user who opens an Access application. The application has no security applied to it. The .ldb has the users listed, but can the .mdb put it into a list inside the .mdb?

View 3 Replies View Related

History/Audit Of Logged Users

Jun 20, 2006

Recording to a table Who is logged on to Database, When they logged on and when they logged off.
Gets tricky as I really would like the info to come from the mdw file(all users go through this for access)
If someone can help would be great. Need my hand held for this as I have been attempting to do this for over a month with no real success. I have so many samples that don’t quite make it happen I am now totally confused.

Forever grateful - every crumb helps

Danson

View 2 Replies View Related

Modules & VBA :: Retrieving User Name Logged Into Windows?

Sep 20, 2013

Continuing with production of my database I've come across another wall that I'm trying to pass. My aim is when the user press the "Quit" button it will export everything to a file which is stored on Google Drive as google drive is installed on the laptops that will be using this database.

However the problem is Google drive is stored in the computer user files i.e C:UsersstudentGoogle Drive - is there a way to retrieve the name of the user that is logged into windows?

Code:

Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal IpBuffer As String, nSize As Long) As Long
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
Function ThisUserName() As String
Dim LngBufLen As Long
Dim strUser As String

[code]....

However cant get this to work - I think that is probably because i'm declaring this code in the wrong place - I've tried declaring the private functions in a class module and the functions in a module - however no success - How do you set this code up? Or is there a new way to do this?

View 14 Replies View Related

General :: Track Who Is Logged On And Authorize Transaction

May 11, 2015

I have a login screen that works fine but I need to lock some part of the system from normal users but I can't figure out how to track if the user who is logged on is security level is high and can authorize the transaction!!!

I have users table and in it I record the users, passwords, security level. So when someone logs on I have no way of knowing who they are and in order check their security level. I did it in the past by setting the C drive VOL into a value and search but as we use Citrix XenApp this is not possible the C drive is the server drive and if multiple users login to to that server then the VOL value would be wrong.

View 3 Replies View Related

Modules & VBA :: Sending Message To Users Logged Into DB On Different Servers?

Jul 23, 2013

I have some code that when a check box in a table is ticked, sends a pop up message to the users logged in (message is on a hidden form), then it closes the DB after a pre-dtermined period of time.

The problem I'm having is that we are a large site with a about 25 differnet servers that our users log onto via Citrix, when a user is on a different server it isn't displaying the message nor closing the DB down.

trying to achieve this? Or is there a better way to see who is logged in and get a message to them?

I'm using Access 2003 btw

Code I'm using below

Code:
Option Compare Database
Private Sub Form_Load()
Me.TimerIntderval = 10000 ' change to 300000 for about 5 minutes
End Sub
Private Sub Form_Timer()
DoCmd.Close
Application.Quit
End Sub

View 9 Replies View Related

Forms :: Last Login Time Stamp For Each User Logged In

Mar 19, 2014

Was trying to set the value of text to current date and time when a submit button is clicked. I've managed to set

Control Name:- txtLastLogin
Property:- Value
Value:- now()

The above expression works but the last logged data in tblEmployee gets replaced as another user logs in.

How can i add a time stamp to each user loged in.

View 2 Replies View Related

General :: Access 2007 Pop-up Message To Logged-in Users

Nov 14, 2012

As an "admin" of our corporate local db, maintaining and/or upgrading is my task.

Usually there are logged-in users, then I have to ask them (mostly via communicator) to please log off, because I can not modify with users in the db.

I would like to send these users a message via Access, like "Please log off from the db for maintenance blabla".

View 6 Replies View Related

Queries :: List Box Data Based On Logged In Users Department

Jan 4, 2014

I have a list box with a row source query as follows...

SELECT qryPendingCompletions2.ID, qryPendingCompletions2.Department, qryPendingCompletions2.[Employee Name], qryPendingCompletions2.CompletionDate AS [Completion Date], qryPendingCompletions2.[Entered By], qryPendingCompletions2.Goal, qryPendingCompletions2.Comments, qryPendingCompletions2.[Verified By]
FROM qryPendingCompletions2
WHERE (((qryPendingCompletions2.Department)=[cbocurrentemployee].[column](3)) AND ((qryPendingCompletions2.[Verified By]) Is Null))
ORDER BY qryPendingCompletions2.Department;

I also have a combo box at the top of the form showing what user is logged in where the row source query is the following...

SELECT Employees.UserID, [First Name] & " " & [Last Name] AS EFullname, Employees.AccessLevelID, Employees.Department
FROM Employees
WHERE (((Employees.AccessLevelID)=1 Or (Employees.AccessLevelID)=2 Or (Employees.AccessLevelID)=3 Or (Employees.AccessLevelID)=4));

How to only list the data in the list box when the department is the same as the logged in user.

So I'd like to add the criteria to the first query something like criteria = [cbocurrentemployee].[column](3) but this doesn't seem to work as criteria in queries.

View 3 Replies View Related

Determine State

Mar 28, 2006

I am trying to determine the state that a job is located in. If the ProjectID begins with a 2 then it is in California. If it does not then the job is located in Nevada.

State: IIf(Left([tblMainFrontierUnits].[ProjectID],1)="2","CA","NV")

What is wrong with this statement? I am getting a compile error.

View 5 Replies View Related

Determine Where Query Used

Oct 7, 2007

How do I determine which forms, reports or other queries use a specific query in my entire database?
Thanks in advance.

View 9 Replies View Related

How To Determine What Objects Use A Query

Jan 14, 2008

I would like to know how to do the following:

Query 'X' is a sum query.
How do I determine which other queries use Query 'X'

I want to make some changes to Query 'X' but I want to be sure of which other queries will be affected.

Thanks

View 1 Replies View Related

Determine Which Page Has Focus.

Feb 2, 2006

Hi,
I have a form with 8 pages (tabs) on it. Each page has a Quit button which populates both a Form name variable and a Question name variable. When a user clicks the quit button the code forces the page name associated with the quit button. I would like to try and catch the same information if someone clicks the DB Close button(s) at the top of the screen. How can I programatically determine what page was/is open when the close db button was clicked? I guess I could create a switch that is populated when a page has focus and then call the last switch value. But I think that seems like extra programming, if I can just call the current page name/index. Is there something like the form name?
E.G.:

MyForm = Me.Form.Name

maybe an active page index or something? The problem is I won't know what page is opened at the time a close button is clicked unless I use a switch of some sort.

Thanks.

View 4 Replies View Related

How To Determine The Label Caption

Aug 25, 2006

On a form I have multiple labels. In the Click event of all these labels I would like to call a generic function for futher processing. For this processing however, I need the caption of the label the user clicked on. How do I determine this caption?

View 2 Replies View Related

How Do I Determine When A Recordset Was Last Updated ?

Dec 5, 2004

Hi Guys

This is an access question, but I am using ASP to manipulate access data.

Q: How do I determine when a recordset was last updated ? Ie a table within a database ?

MTIA

Darrin

View 1 Replies View Related

Determine The Next Latest Date

Jan 17, 2005

I am hoping someone may be able to help me with this one. I have a set of dates that I would like to query for the next latest date based on certain criteria. Not sure if I explain clearly, if more info is required, please advise. Thanks so much in advance for your help.

View 4 Replies View Related

How To Determine Table Sizes (in Mb)

Dec 4, 2012

I have a multiuser database back end with approximately 25 tables. The file size for the back end has recently jumped from approx. 50mb to 270mb, but I do not know where the data causing this increase is placed. Is it possible to measure the file space usage (in mb) that each table contributes so that I can determine the source of the increase.

View 1 Replies View Related

How To Determine Whether Or Not A Listbox Has Items Selected...?

Oct 6, 2006

Hello.

As my title states, that is my problem! I'm building search criteria from a form and have multiple list boxes... I want to be able to determine whether or not a list box has items selected or not. I have tried as many things as i knew how to with no luck...

Also, i searched the forum but could not find what i was looking for -_-

Thanks for any and all aide!

View 2 Replies View Related

Use Code To Determine If A Record Is On A Query Or Not

Jun 6, 2007

I have a form that shows employee license information. I also have a query & form based on that query to show licenses currently suspended. I would like to on my employees form to flash "license suspended" label if their name/record id is on the license suspension query. For all employees whose license isn't suspensed I would don't want anything to show. I can get the label to flash and to appear. I just need help evaluating the query and comparing it to the current record. Example I

if me.id = queryname.id then....execute label flashing, etc.

Can I write code to do this? Thank you

View 4 Replies View Related

Using Country Field To Determine VAT Rate.

May 9, 2007

hey,

i have a customer form which includes a "Country" combo box.. the reason i did this is because i have a separate table with a list of countries and their VAT (Value Added Tax, you americans call it sales tax i think :)) rates.

i want this country saved in the customers table.. i need the country table to act merely as a source of data. Now ive spent a good hour tying to fix it messing around with the relationship between the two tables and the combo box itself.. but ive only been able to come to two end results

a) access tells me i cant save the new customer record cause a related record is required in the country table.

b) access enters a new line in my country table with the autonumber of the country selected on the add new customer form in the Country field.

im stumped as to where the problem is:// how can i fix it?

View 5 Replies View Related

Using Two Dates To Determine If Someones On Site...

May 3, 2007

Hi,

I need a little help with my Query design.

I have an Arrival Date and a Departure Date for campers checking in on a campsite. I need to produce a report for the warden to have to check who's on site.

So far, the best way I though was using a new field in the query for "On Site" (which isnt in the control table) and then using an expression such as...

[Date of Departure] < Date()

However this isnt working, probably for some silly oversight on my behalf.

Any help?

Thanks, Adzi.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved