This topic is locked

How to filter AJAX Auto-Suggest by logged user?

3/10/2008 10:26:44 PM
ASPRunnerPro General questions
G
Gilberto author

Hi,

i am evaluating ASPRunnerPro 5.1/327
I have a simple Access db with two tables.
I enable "Create login page" and in "Advanced security setting"

check "Users can see and edit their own data only" for all the tables.
In the "_list" page i correctly see the records from the table filtered

by the logged user.
But i've noticed that in the search form (Basic and Advanced)

the "AJAX-based Auto-Suggest" feature show all the records from the table

without filtering by logged user.
Is this a normal behaviour?

Is there a way to filter the "Auto Suggest" result?
Thanks,

Gilberto.

Sergey Kornilov admin 3/12/2008

Gilberto,
when you setup Lookup wizard you can add a WHERE clause to filter data.
Example:

" UserID = '" & Session("UserID") & "'"
G
Gilberto author 3/12/2008

Thanks Sergey,
i'm aware of that functionality in the Lookup Wizard,

but i'm not talking about Lookup Table.
I refer to the "Ajax Auto-Suggest feature" when you start

to type in the search box (Basic or Advanced) and the field

autocomplete with "suggest".
Here's an image taken from the AspRunner Manual:


As far as i know the "Ajax Auto-Suggest feature" makes

a background query to the database, and then show up the

result when you start to type in the field.

My problem is that the query seems not filtered with a WHERE,

as a matter of fact the "Auto Suggest" show records from

all the database regardless of the logged user,

although i check "Users can see and edit their own data only"

in "Advanced security".
I hope i'll explain myself.
Gilberto.

J
Jane 3/13/2008

Gilberto,
thank you for pointing me to this bug.

We'll fix it in the next ASPRunnerPro update.
To make your pages working open C:/Program Files/ASPRunnerPro5.2/source/searchsuggest.asp file, find this line:

' strWhereClause = whereAdd(strWhereClause,SecuritySQL("Search"))



and replace it with this one:

whereCondition = whereAdd(whereCondition,SecuritySQL("Search"))


Then open and rebuild your project.