This topic is locked

After Login use the username to login to the database using SQL Server

7/6/2022 12:08:19 AM
PHPRunner General questions
A
asawyer13 authorDevClub member

I am using PHPR 10.7 and SQL Server.

Once the user logs into my app, I want to relogin to the database using their username.

I have already added their username to SQL Server and I know the password, so just need a way to login into their account.

Thanks
Alan

A
asawyer13 authorDevClub member 7/6/2022

I am thinking I might need to add some sort of second connection like the saas example, but wondering if there is a simpler way.

Alan

Sergey Kornilov admin 7/6/2022

Alan,

could you provide the whole picture? What this change of login is supposed to achieve? Do they connect to the same database? Just not clear what the benefit is.

A
asawyer13 authorDevClub member 7/6/2022

The user will connect to the same database, however using a sql login. I want to do this for a few reasons, but I want to track all data changes, and I need something more robust than the default PHPR stuff. I have stored procedures that may update/insert/delete multiple records and I want the sql server logged in user id to be associated with those changes.

I'm trying the SAAS method, but have not been successful. There may be multiple problems, but I don't know how to associate the second database connection to use the second Output connection that I created. Instead of changing the database name, I am changing the username and password, but it's not working. Not sure if it should or not.

Does that make more sense?

Alan