This topic is locked

1 DB many users

7/21/2003 4:47:46 PM
ASPRunnerPro General questions
author

Hello there,

I am posting to internet a DB showing a list of used cars from several dealers. To update the DB, I need to manually add/remove cars every week.

I understand I can give to each dealer an username/password so that they can make their own changes but.....I want to limit them to their own information thus not allowing them to modify data that doesn't belong to them.

How do I establish their limits? Do I need to create a DB table for each of them?

TIA

Sergey Kornilov admin 7/24/2003

Emilio,
here is how it can be done:
Lets assume that you store login/password information in a separate table. This table should also have a field named DealerID.
Login (Text), Password (Text), DealerID (integer)
When dealer logs in you retrieve this information and store DealerID in session variable:
Session("DealerID") = rs("DealerID")
You main table with information about used cars should also have this DealerID field. Now on the list page you modify SQL query by adding new WHERE condition
*strSQL = "SELECT from UsedCars WHERE DealerID = " & Session("DealerID")**
This will allow dealers to view and edit their own listings only.
Feel free to contact me if you need more info.
Sergey Kornilov

500054 7/25/2003

Sergey,

I added the 'Session("DealerID").....' line right below the 'Session("UserID") = ......' line in the Ligin.asp page and modified the 'strSQL....' in the list.asp page.

The DealerID is a primary key in the tblSecurity table.

With all this, the list page still paints everyone's data. Am I still missing something?

Thanks much.

Emilio

Sergey Kornilov admin 7/27/2003

Emillio,
I cannot tell you what's wrong without seeing actual code.
Could you zip and send me the whole content of your output folder (all ASP files and your database)? Just send it to support AT xlinesoft.com.
Sergey Kornilov