Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    DanT is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2022
    Posts
    23

    Quote Originally Posted by NoellaG View Post
    You're working with a SQL database which has a very fine 2-level security system using logins on server level and user rights on the database level. You can use them to set the rights per object, even to the row (using views) /column level. You have there standard built-in functions and variables to get the current user for example: select system_user gets the logged in windows user.
    And tracking is standard available on the database, just activate it:
    Brilliant! I managed to set up login for myself in SQL Server but it didn't change much when it comes to playing with database via Access. Would you kindly point out how to set it up so this affects Access as well?

  2. #17
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,043
    Hi,

    you can create on sql server a table-valued function that returns all info from the current session:

    Code:
    USE [MyDatabase]
    GO
    
    
    /****** Object:  UserDefinedFunction [dbo].[f_getSessionInfo]    Script Date: 6/09/2022 10:14:37 ******/
    SET ANSI_NULLS ON
    GO
    
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    
    -- =============================================
    -- Author:        NGA
    -- Create date: 
    -- Description:    Example
    -- =============================================
    CREATE FUNCTION [dbo].[f_getSessionInfo] 
    (    
        
    )
    RETURNS TABLE 
    AS
    RETURN 
    (
        select session_id, login_name , login_time, host_name, program_name, client_interface_name, nt_domain, nt_user_name
        from sys.dm_exec_sessions where session_id = @@SPID
    )
    GO
    Using a command object in Access you can use the recordset it produces
    you can even link the view sys_dm_exec_sessions to your access database, but then you have the info of every session on your database
    In the SSMS the command:
    select * from [dbo].[f_getSessionInfo]()
    returns:
    Attached Thumbnails Attached Thumbnails sessioninfo.JPG  

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Visitors signing in and out DB
    By Roza in forum Access
    Replies: 6
    Last Post: 04-20-2016, 09:46 AM
  2. Signing in
    By ictcrystal in forum Forms
    Replies: 6
    Last Post: 04-03-2015, 04:10 PM
  3. login driving auto populating
    By Chekotah in forum Forms
    Replies: 3
    Last Post: 04-29-2014, 05:07 PM
  4. Signing an Access Database
    By mmcgrath in forum Access
    Replies: 4
    Last Post: 07-18-2012, 12:46 PM
  5. Auto Login
    By gripper in forum Programming
    Replies: 1
    Last Post: 08-30-2010, 06:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums