Passing a param via URL for SQL Where clause |
9/24/2008 4:42:28 PM |
ASPRunnerPro General questions | |
S
sfkjeld author
Need to call my ASP runner project from foreign application. Want to pass the DepartmentCode so everyone accessing the project only sees their own Department records. |
|
![]() |
Sergey Kornilov admin 9/24/2008 |
This event didn't exist in ASPRunnerPro 4.0. Consider upgrading. strWhereClause = whereAdd(strWhereClause, "DeparmentCode = '" & Request("DeparmentCode") & "'") |
S
|
sfkjeld author 2/4/2009 |
This event didn't exist in ASPRunnerPro 4.0. Consider upgrading. In later versions of ASPRunnerPro you can use the following code in BeforeSQL event: strWhereClause = whereAdd(strWhereClause, "DeparmentCode = '" & Request("DeparmentCode") & "'")
|
J
|
Jane 2/5/2009 |
Hi, if Request("DeparmentCode")<>"" then strWhereClause = whereAdd(strWhereClause, "FieldName = '" & Request("DeparmentCode") & "'") end if
|
S
|
sfkjeld author 2/19/2009 |
I am still not having any luck with this. I even tried to hard code the param I wanted to pass and it still doesn't work. Hi, here is a sample URL: http://showdepartmentrecords_list.asp?Depa...ntCode=Medicine and here is a sample event code: where FieldName is your actual field name. If it doesn't help please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. |
S
|
sfkjeld author 2/19/2009 |
Wups, just found a prob. When I pass the param to limit/filter the recordset, it works fine. But as soon as a Edit a record, the limit/filter is lost when it returns to the List page. I'd the filter to remain in effect for the entire session. Sorry, after I posted this, I tested all the List Page events and found the correct one. It is working fine. Please disregard. '** Custom code **** ' put your custom code here strWhereClause = whereAdd(strWhereClause, "RefProviderCHNnum = '001040'") I would expect this to filter by RefProviderCHNnum. It still shows all records. Am I putting it in the wrong event? I can't post the project, since it resides on our intranet. Appreciate any help you can provide. |
S
|
sfkjeld author 2/19/2009 |
I don't like it, but I am now passing the filtering through the Search controls. It works, but of course, a user can easily change the Search criteria and is then seeing records they should not. Wups, just found a prob. When I pass the param to limit/filter the recordset, it works fine. But as soon as a Edit a record, the limit/filter is lost when it returns to the List page. I'd the filter to remain in effect for the entire session. |
J
|
Jane 2/20/2009 |
Hi, strWhereClause = whereAdd(strWhereClause, "RefProviderCHNnum = '001040'") |
S
|
sfkjeld author 2/20/2009 |
Hi, to filter records on the page useList page: Before SQL query event:
|
![]() |
Sergey Kornilov admin 2/20/2009 |
Save it in Session variable. if Request("RefProviderCHNnum")<>"" then |
S
|
sfkjeld author 2/23/2009 |
Save it in Session variable. In BeforeSQLQuery event you can use the following: if Request("RefProviderCHNnum")<>"" then
|