Capture Manager Login

Anyone any idea how to capture the user logged into the manager program. I have written some triggers creating log tables for various actions and it would be really good to be able to record the user at the time.

Reply to
David
Loading thread data ...

Hi David, I wrote an Update trigger on the cashier table in our DB that writes information to a custom table whenever someone enters incorrect info and the login fails. The name of my custom table is c_CaptureFailedLogons. Here's the trigger:

CREATE TRIGGER tr_LoginAttempt ON Cashier FOR UPDATE AS IF @@ROWCOUNT 1 RETURN

IF (SELECT FailedLogonAttempts FROM INSERTED) > 0 BEGIN DECLARE @Cashier INT SELECT @Cashier = Number FROM INSERTED INSERT INTO c_CaptureFailedLogons (CashierID, ClientComputerName, Time) VALUES (@Cashier, Host_Name(), GetDate()) END

My trigger only inserts data into my custom table if the number in the FailedLogonAttempts column of the cashier table is incremented up by one, or in other words if the logon fails. The column value is set to zero everytime there is a successful logon so you could remove this if statement in my trigger and it could be set up to write info to a table for you every time a user logs in. In my case I have it capture the cashier id logging in, the name of the computer they are accessing RMS from, and the time. Let me know if you have any questions.

hth kevin

"David" wrote:

Reply to
kskinne

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.