Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 06-17-2004, 12:07 PM   #1 (permalink)
 
Newb Techie

Join Date: Jun 2004

Posts: 10

techthis

Question Session Variables in ASP

hi...i did a search for Session variables and only found them relating to PHP...im using asp...ive created a form when a user clicks next it brings up a page that displays their info...if they agree, their info is passed to a database...i cant seem to get the session variables to stick when going from display.asp to insert.asp...here is my code...

---display.asp--- (works fine)
<%
'declare your variables
Dim name, email, comments

Session("name") = Request.Form("name")
Session("email") = Request.Form("email")
Session("comments") = Request.Form("comments")

response.write(Session("name")) & "
"
response.write(Session("email")) & "
"
response.write(Session("comments")) & "
"
%>

---insert.asp--- (does not work)
<%
'declare your variables
Dim name, email, comments
Dim sConnString, connection, sSQL

Session("name")
Session("email")
Session("comments")

'declare SQL statement that will query the database
sSQL = "INSERT into tempusers_tbl (name, email, comments) values ('" & _
name & "', '" & email & "', '" & comments & "')"

'define the connection string, specify database
'driver and the location of database
sConnString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("users.mdb") & ";"

'create an ADO connection object
Set connection = Server.CreateObject("ADODB.Connection")

'Open the connection to the database
connection.Open(sConnString)

'execute the SQL
connection.execute(sSQL)

' Done. Close the connection object
connection.Close
Set connection = Nothing
%>



...i dont think im calling the session correctly in insert.asp...ive tried a number of ways...thanks for your time...
techthis is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On