This topic is locked

session variable

8/16/2007 10:23:05 AM
ASPRunnerPro General questions
K
kwilsokl author

Hi
I have created a login page for my database and I want to display pages or queries based on the session variable. I have looked through the forms and I understand I need to capture the session variable for the login page. Can some one give me some example code as to how to capture it and assign it to a page or a query?
Thank you for any help

Sergey Kornilov admin 8/16/2007

The easiest way is to use Advanced Security method Users can see and edit their own data only.

K
kwilsokl author 8/16/2007

I am not sure how that will help me achive the following.
I am trying to create dashboards where it displays reports ro query output based on the user. I need to to bring up the menu page and beside displaying the menu also display 2 report queries for that current logged in user
The quey looks like this

SELECT tblParolee.ParoleeID, tblParolee.LastName, tblParolee.FirstName, tblParolee.CareCoordinators, tblCaseNotes.ContactDate

FROM tblParolee LEFT JOIN tblCaseNotes ON tblParolee.ParoleeID = tblCaseNotes.ParoleeID

GROUP BY tblParolee.ParoleeID, tblParolee.LastName, tblParolee.FirstName, tblParolee.CareCoordinators, tblCaseNotes.ContactDate, Month([ContactDate])

HAVING (((tblParolee.CareCoordinators)="Craig Judd-ICS") AND ((Month([ContactDate]))=Month(Now())));

Sergey Kornilov admin 8/16/2007

I see what you saying.
In this case you can use Session("UserID") variable that holds logged user name.

The best play to build a SQL query like this is Before SQL query event.