This topic is locked
[SOLVED]

 User Defined Session variable to filter List Pages

10/14/2014 6:18:42 AM
ASPRunnerPro General questions
K
kleanthis author

Dir Sir/Madam

I need your help in the following topin.

I am using SQL.

I have a table (User).
Username

Password

Name

entry1
and a table (Sales) with my users entries.
Password (of the user)

entry1

entry2
I want to make different views list according to the entry1.
I don't want to Add View(from the Tables) and use the WHERE (entry1 ='samething') in the Query SQL, but I need a code when the user login to read entry1and filtermy Sale list view.
Thanks

kleanthis

admin 10/14/2014

Use Advanced Security mode 'Users can see and edit their own data only':

http://xlinesoft.com/asprunnerpro/docs/advanced_security_settings.htm

K
kleanthis author 10/14/2014

I use this ability of ASPRunner. In addition of that I want a code when the user is login, to read entry1and filtermy Sale list view.


Maybe a code in the event tab, in after successfully loginto read the entry1and in the List page: Before SQL query a WHERE (entry1 ='samething').
Thanks

KK

admin 10/15/2014

If I understand your question right you need to use AfterSuccessfulLogin event to read that value (entry1 field) and to save it in some session variable. Then you can use Dynamic SQL Query approach described in this article: http://xlinesoft.com/asprunnerpro/docs/dynamic_sql_query.htm

K
kleanthis author 10/18/2014

What I did
In the Login page - After successful login - event

SESSION("lookupentry1") = DATA("entry1")


In the List Page - Before Query List - event

strSQL = addwhere (strSQL, "[entry1]='" & SESSION("lookupentry1") &"'")


WORKS FINE BUT
In my list page the details must be 125 and not all 1521 them. Also when I press the "last" in the navigation panel I get this error
ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/dbo_TeachersCo_ICT_list.asp, line 0
Pls help

Kleanthis

admin 10/18/2014

You need to use the code supplied in the manual. You are using some other variation.

http://xlinesoft.com/asprunnerpro/docs/dynamic_sql_query.htm

K
kleanthis author 10/19/2014

I used this code and works fine.

strWhereClause = whereAdd(strWhereClause,"entry1='" & Session("lookupentry1") & "'")


Thx for your help

KK