Avatar of sms_toad
sms_toad
 asked on

MisMatch error Using Session

I am trying to use session vars to pass the info from an input form ( dumping into SQL DB ) to the resulting 'Thank You' page.

I have used this as an example of getting input vars from my Sign-up page:
LastName=request.Form("LastName")
I add it with the
SQLStmt syntax and dump it into the Db...No Problem

-----Problem Starts------
<% Session("LastName")="VarLastName" %>

It throws this error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Session'
...Line 497

----Problem-------------

I then use a Response.Redirect "Thank_You.ASP"
and I want to pull the info thru to personalize the page

I've tried this at the top, middle, bottom of the page and can't get it to work.  This error occurs on page load and stops all activity.  I can't get the SUBMIT to work,
Any help appreciated.  


Thanks,

Brad
Adobe Flash

Avatar of undefined
Last Comment
Computer101

8/22/2022 - Mon
henryww

have u posted the msg in the wrong area?
... hmmm not sure.
never happen to me b4,
looks like u may have a session timeout
how often does it happen?
u don't have to user session to get the form post even after u insert into dB, u can still use request.from (that if ur insert script and thankyou page in one asp file)

type put these in ur code, to set the timeout to 60min
<% sessionTimeout = 60 %>

hope it helps
cheers
elhy

1). Just curious, why do u want to store the value "VarLastName" to Session("LastName") since your already have the value for request.form("LastName")? I mean why not session("LastName") = request.form("LastName")

2). You may want to post all your code or at least more than what u have above so that we can debug further. Coz the problem might be from other lines and slowly leads to that line.

sms_toad

ASKER
Thank you for your answers.  

It turns out that the mistake was on my part.  I was trying to POST and GET the data & I posted my question to the wrong area.

Sorry,

Brad
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
henryww

that's ok :)
ASKER CERTIFIED SOLUTION
Computer101

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.