Hello,
I have an asp page that checks the user id, then goes to an acces db to check user credentials, if the user gets authenticated, the user gets redirected to see his data only. This works well. I am trying to ad an admin user. To be able to see all the records
here is what my code looks like
The " &presentuserid& " is a number field in my access db
If one of the users has more than one account and would like to see the account I have added
in(1,2,3) in the access db field and that shows the user data for departments 1, 2 and 3.
But for the admin I would like to see all.
I have tried putting an * but that does not work and the thin is that I cannot say in(1,2,3,4,5,etc.) because it could go over 5000 and access does not let me do that.
any ideas of how could I tackle this one?
thanks!!!
I have an asp page that checks the user id, then goes to an acces db to check user credentials, if the user gets authenticated, the user gets redirected to see his data only. This works well. I am trying to ad an admin user. To be able to see all the records
here is what my code looks like
Code:
<%
Username = Request.Form("txtUsername")
Password = Request.Form("txtPassword")
'Build connection with database
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("\mydb.mdb")
set rs = server.CreateObject ("ADODB.Recordset")
rs.Open "SELECT * FROM spartan where username='" & Session("Username")& "'", conn, 1
Dim presentuserid
presentuserid=rs("userid")
strTableName="WEBSPA.WEEKLYSLS"
Session("OwnerID") = Session("_" & strTableName & "_OwnerID") ' to support older events and default values
strOriginalTableName="WEB.WEEKLY"
gPageSize=50
gstrOrderBy=""
if len(gstrOrderBy)>0 and lcase(mid(gstrOrderBy,1,8))<>"order by" then gstrOrderBy="order by " & gstrOrderBy
gsqlHead="SELECT TERR, YEAR, WEEK#, FECHNB, FEGGNB, DHCANB, FEAADM, FEGHNB, DDAITX, DDALTX, DDARQT, DDDPVA, DHA3CD "
gsqlFrom="FROM WEB.WEEKLY "
gsqlWhere="FECHNB = " &presentuserid& " "
gsqlTail=""
gstrSQL = gSQLWhereAdd("")
%>
The " &presentuserid& " is a number field in my access db
If one of the users has more than one account and would like to see the account I have added
in(1,2,3) in the access db field and that shows the user data for departments 1, 2 and 3.
But for the admin I would like to see all.
I have tried putting an * but that does not work and the thin is that I cannot say in(1,2,3,4,5,etc.) because it could go over 5000 and access does not let me do that.
any ideas of how could I tackle this one?
thanks!!!