This topic is locked

session variable name

8/19/2007 1:33:39 PM
ASPRunnerPro General questions
K
kwilsokl author

When a login page is created, what is the session variable called or named in the code so I can capture it in SQL
Thank you

Sergey Kornilov admin 8/19/2007

I guess you are looking for Session("UserID")

K
kwilsokl author 8/20/2007

Yes, thank you. I appreciate your prompt replies. I am new to this are trying to learn it. The product is really great!

K
kwilsokl author 8/20/2007

ok, I think I am almost there, but I cant get past the SQL editor on ASP Runner. I am trying to have it filter by the session ID, below is my code but I keep gettng a statement error where it will not let me go to the next screen
select [ParoleeID],

[LastName],

[FirstName],

[CareCoordinators],

[ContactDate],

[AuthUNits],

From [ACauths2]

Where[CareCoordinators]=session[userid]

Sergey Kornilov admin 8/20/2007

You cannot use session variables on the SQL query tab
Use BeforeSQLQueryevent and the following code:

strSQL = AddWhere(strSQL, "[CareCoordinators]='" & session("UserID") & "'")
K
kwilsokl author 8/21/2007

You cannot use session variables on the SQL query tab

Use BeforeSQLQueryevent and the following code:

strSQL = AddWhere(strSQL, "[CareCoordinators]='" & session("UserID") & "'")


Ok would that be added to the events tab under the list page and then I would select custome code and create a new sub called BeforeSQLQuery
Thanks

Sergey Kornilov admin 8/21/2007

BeforeSQLQuery event already exists in ASPRunnerPro 5.1.

K
kwilsokl author 8/21/2007

Ok I apologize for all the questions. I am using ASP Runner PRO 5.0 build 275. I have checked and checked and I can't find the BeforeSQLQuery event. Is there actually a 5.1 version because I just went to the home page and I did not see a newer version there
Thank you for the help
Sorry I just saw the 5.1 beta, I guesss I will have to wait until the final version is out unless there is another way to do this in 5.0

C
chris 8/21/2007

Ok I apologize for all the questions. I am using ASP Runner PRO 5.0 build 275. I have checked and checked and I can't find the BeforeSQLQuery event. Is there actually a 5.1 version because I just went to the home page and I did not see a newer version there

Thank you for the help
Sorry I just saw the 5.1 beta, I guesss I will have to wait until the final version is out unless there is another way to do this in 5.0



The beta is pretty stable from what I have used so far, some things(bugs, if you want to call them that) are there but usually only for the enhancements. If you want to see if what he suggest works, you can run both 5.0 and 5.1 on the same pc, just use the project file from 5.0 and save it as a new 5.1 project and that way you can go back if you need to do that.

Hope that helps.

Chris.