OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Setting Access Table Value for Session

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Setting Access Table Value for Session
Page: [1]
 
Mav44

 

Posts: 197
Joined: 6/25/2006
Status: offline

 
Setting Access Table Value for Session - 10/16/2009 18:58:04   
Hi, I am using the following login script to pull from an access database. I would also like to be able to pull other variables such as "repgrp" from this database to be used during that session on other pages. My login looks like:


<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim myConn 
'Query to be executed
Dim SQLQuery 
'Recordset
Dim rs 
'StudentNo Of Logged in user
Dim UserName 
'Password of User
Dim Password
set Conn=server.createobject("ADODB.Connection") 
'Creating Recordset Object 
set rs = Server.CreateObject("ADODB.Recordset") 
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" 
connStr = connStr + server.MapPath("mymembers.mdb")
Conn.open connStr 

Dim Conn, oRSu
username = request.form("username")
password = Request.Form("Password")
repgrp = Request.Form("repgrp")
if Session("ausr") = "" or Request.Form("usrname") <> "" then
Session("ausr") = ""
Set oRSu = Conn.Execute("SELECT * from users where username = '" & username & "' and password = '" & password & "' ") 

if oRSu.EOF then 
Response.Redirect "zlogin.asp?username=" & UserName 
End if 

if not oRSu.EOF then

Session("ausr") = trim(oRSu ("username"))
Session("repgrp") = Request.Form("repgrp")


If Len(Request("requester")) > 0 Then
Response.Redirect (Request("requester"))
Else
Response.Redirect "zlogin.asp?UserName=blank"
End if
end if

end if
%>


I would then like to put something like this on any page in my site that would bring the value for "repgrp" to that page. Something like:


repgrp = session("repgrp")

sql = "select * from mydata where status = 'Pending' and repfirm like '%" & repgrp & "%' "


I have been unable to get the "repgrp" session results results sent to the other pages. Any help is greatly appreciated!
Spooky

 

Posts: 26680
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Setting Access Table Value for Session - 10/17/2009 1:36:01   
Does repgrp come from the database?
If so, why not do this?

Session("repgrp") = oRSu("repgrp")

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to Mav44)
Mav44

 

Posts: 197
Joined: 6/25/2006
Status: offline

 
RE: Setting Access Table Value for Session - 10/17/2009 1:42:10   
That is it. I changed Session("repgrp") = Request.Form("repgrp") to Session("repgrp") = trim(oRSu ("repgrp")) and everything is working great!

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Setting Access Table Value for Session
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts