
Ville
|
| Posted: 04/09/2003, 5:51 PM |
|
I've been sifting through this forum trying to find a simple example for how to pass the userID from the login page to the [following] page, which contains a grid. I'd like to filter grid contents from a database using the userID in the WHERE clause.
I have the custom code in place in the grid that seems to work, i.e.
--
IDPro_Requests.DataSource.Where = IDPro_Requests.DataSource.Where & "AssignedTo = '" & UserName & "'"
--
I can set UserName = "somename" on the [grid] template's main ASP page and the grid filters correctly using it. But so far I haven't successfully been able to assign the userID, or login, into the UserName variable (in other words, this is an ASP newbie question; in PHP this would've taken me couple of minutes :).
This is probably a super simple thing to do, eh? :)
|
|
|
 |
Johnny
|
| Posted: 04/09/2003, 6:10 PM |
|
i doit this way if noone post another way take a look:
in your grid:code page look
for this this string with find WHERE =
you will find this sentence
Where = ""
change that sentence for this 3 new sentences
__________________________________________________
dim weallarenewbie
weallarenewbie = ccgetuserID()
where = " youfieldID = weallarenewbie "
__________________________________________________
be aware of spaces
|
|
|
 |
Rene
|
| Posted: 04/10/2003, 9:23 AM |
|
Can you, or someone else give some more explanation.
I would like to achieve the following:
A user logs in and after logging in he only gets to see forms,grids and records that are connected to his member_Id. Can someone give me a detailed, step by step instruction how to do that. Keep in mind that I'm a non-programmer, but eager to learn.
The table from wich I want to extract the data from is a query called [lever Query]
The fields inside this query are:
from table [lever] field "lever_Id"
from table [members] field "first_name"
from table [members] field "Last_name"
from table [members] field "bedrijf"
from table [table_1] field "nummer"
from table [table_1] field "naam"
from table [members] field "member_Id" wich is the User Id field in my project settings.
Thanks in advance,
Rene
|
|
|
 |
gmoore
|
| Posted: 04/10/2003, 1:18 PM |
|
Look in your project settings > security > advanced security settings to find the userid variable for your project.
In the Datasource for the GRID:
1) add (+) a parameter
2) Select the userid (or whatever the login id is) for the field.
3) Type the userid variable in the parameter source textbox.
4) Select session for the parameter type.
This will limit the displayed results to those that are associated with the logged on user.
|
|
|
 |
Johnny
|
| Posted: 04/10/2003, 8:59 PM |
|
Gmoore way work too.
But that way you could still type you own parmater in the adress bard fro another user and readit info that dont belong to you if that no a problem it work!
but i like just filter in the query!
|
|
|
 |
|

|