CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 How do I ?

Print topic Send  topic

Author Message
kevin
Posted: 10/30/2003, 4:37 AM

Guys I am stuck on this one and I confess that I am just starting out on
Codecharge and ASP, so do bear with me.

Info on my Access Database
Employee Table
EmployeeID (PK)
EmployeeName
Login
Password
Security_Level

Plan Table
PlanID (PK)
PlanMemo
EmployeeID (PFK)

I start out with the Login Page as my Default Page.
On login it leads to my second page with a grid form showing Plan Number,
Employee Name and Plan Memo records.
I want to be able to
1. Get only those records of the Employee based on his login

2. Get all employee records based on the login security level. i.e.
Admin1 based on his Login & Security Level 1 gets access to all records of Employee with security Level 1.
Admin2 based on his Login & Security Level 2 gets access to all records of Employee with security Level 2.
Admin3 based on his Login & Security Level 3 gets access to all records of Employee with security Level 1 & 2.

I am stuck on the ASP scripts that I need to do the above and would appreciate any help.
Thanks.
ryan
Posted: 10/30/2003, 3:40 PM

hmmmm.....

You know the CodeCharge interface for datasource right, you have your record form already for Plan Table

Therefore you just add a parameter UserID, which is a Session not URL.

Basically your generated SQL would be something like
SELECT * FROM PLAN
WHERE EmployeeID={UserID}

But do not customize the SQL (maybe sooner) let CC handle it.

Then you need to restrict access to that page so that the moment users visit it only the records shown particulary to them will be displayed :)
kevin
Posted: 10/31/2003, 11:43 AM

I had figured out that I needed to put in a parameter in my grid form for Plan
Table. As per my Plan Table I had put EmployeeID. I changed it to Session
instead of Param as Type in Form Properties->Input as you advised to no result.
I also have Number for DataType, = for Operation and Required checked.

As per my Plan Table, when I try to add a parameter the fields available to me
are PlanID, PlanMemo & EmployeeID. Accordingly I use EmployeeID as my input
parameter. It seems to me I need to actually put in Login as my input
parameter but am unable to do so as Login is from the Employee Table.

I think my database design is good, and I just cannot figure how to solve this.
Can you give me more detailed step by step instructions. It probably is
something simple that I am missing but as I am new to this tool I'm not seeing
things too clearly.

Also how do I restrict access by Login so that only the records particular to
the user are shown ? I can restrict access by Security_Level where all those
employee records of a particular lever are displayed.

Is there any app that I can sample that has the login page as the default page ?

Help I am still stuck.

Note : I am using CodeCharge 2.0
kevind
Posted: 10/31/2003, 12:01 PM

Hi Kevin,

I gather you will have 2 user types here:
1. Actual Employee allowed to login and see their data
2. Administrators with various clearance levels

I also assume your using an authentication table hooked into CodeCharge. I would add an employeeID column to that table, then once the user is logged in you can use CCDLookup function to lookup the employeeID from the authenticate table where ID=CCGetUserID.

For the admin type user, add another column with their clearance level (0 if not an admin person) and then use the same technique to lookup this information.

I generally use an OnBeforeShow event for the page to lookup this information and store into session variables for use later in records / grids etc.

You could then have a redirect to either an employee page or an admin page.

Hope these ideas help.
You can also reach me directly at

kevin_dalby
at
kkdalby.com (messed up address to thwart spammers)

Kevin

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.