Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1052731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:08:26+00:00 2026-05-16T17:08:26+00:00

I have an MS Access 2003 mdb and mdw which is connected to a

  • 0

I have an MS Access 2003 mdb and mdw which is connected to a SQL server backend. The tables are linked using a system DSN. I have a trigger on a SQL back end table which inserts a record into another back end audit table on insert, update, and delete. This all works well, but the trigger is using system_user to get the person making the record change, and the table is just recording the username the DSN is setup to use when that change is made in the linked Access table. If the DSN is set to use the generic sql username ‘foo’ and the MDW is using the user specific name ‘bar’, the audit table on the backend if recording all changes by all users as the user ‘foo’. The users are logging in to the mdb with an mdw file, and I’d like to record the username from the mdw in the SQL backend. Is this at all possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:08:27+00:00Added an answer on May 16, 2026 at 5:08 pm

    I bet @@spid in the trigger works because it is executed by the process doing the DML.

    Just be aware that this may not always be reliable because sometimes Access opens additional connections without having any way of running your special code to log the user against the spid in use.

    Update

    Have you considered using the CONTEXT_INFO variable that is specific to each SQL Server session?

    DECLARE @Info varbinary(30)
    SET @Info = Convert(varbinary(30), 'My Username')
    SET CONTEXT_INFO @Info
    SELECT Left(Convert(varchar(30), CONTEXT_INFO()), CharIndex(0x0, CONTEXT_INFO()) - 1)
    

    This may mean hitting a table behind the scenes anyway, but it’s surely going to be faster than doing it yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MS-Access 2007 client using a MS-Access 2003 MDB frontend and backend
We have a system with an Oracle backend to which we have access (though
I have an Access 2003 database MDB where all of the tables exist as
So I have an access mdb file that was originally create using Access 2003/Office
I have an Access 2003 project in which all data is stored in SQL
I have a MS Access 2003 mdb acting as a front end for a
System: Windows7, Access 2003, .mdb file, C# language, VS 2010 I'm doing queries with
I have been successful in querying a Microsoft Access 2003 database (.mdb file) and
I have the following query in access 2003 mdb. SELECT Company.Name, Company.Address, Place.Name_of_Place, Sum(Income.Value)
I am using Access 2003 and I have a form that collects some filtering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.