Session variable Problem 
Author Message
 Session variable Problem

Hello,
    I need a bit of help with a simple problem that is I seem to have with a
Session variable that I am trying to set to retreive records from a Sql
server using a Sql statement.

    I know that the statement works because I used the same .asp pages and
statement in another part of the application. the only differences is that I
this time I am using the session variable to store a character string
instead of a number.

the code looks similar to this

 LookUPLastName = Request.("txtLastName")

the sql looks basically like this   "SELECT LastName FROM V_PlayerFamily
WHERE LastName = " & LookUPLastName

I get the error that the column is invalid. the column that is indicated is
the name that I enter into the form that I am storing as a session variable.

Again the code works fine when I use it to retreive the records from the
same table using the same sql using a number.

Thanks inadvance
Gary



Sat, 03 Jul 2004 05:18:54 GMT  
 Session variable Problem
1. This variable "LookUPLastName " is not a session variable.
2. If you are storing a string in the variable then shouln't the SQL be built like this
    "SELECT LastName FROM V_PlayerFamily WHERE LastName = '" & LookUPLastName & "'"
    (Not the single quote)
3. I really don't know hoe this worked with a number

HTH
--
Trevor Benedict R
Microsoft Certified Professional
Mascot Malaysia.



Sat, 03 Jul 2004 12:07:48 GMT  
 Session variable Problem
Thanks, that did the trick.



Quote:
> 1. This variable "LookUPLastName " is not a session variable.
> 2. If you are storing a string in the variable then shouln't the SQL be
built like this
>     "SELECT LastName FROM V_PlayerFamily WHERE LastName = '" &

LookUPLastName & "'"
Quote:
>     (Not the single quote)
> 3. I really don't know hoe this worked with a number

> HTH
> --
> Trevor Benedict R
> Microsoft Certified Professional
> Mascot Malaysia.



Sun, 04 Jul 2004 00:00:30 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help! Storing Arrays in Session Variables - problem

2. Problem persisting Session variables.

3. Problem with SESSION VARIABLES using netscape when opening a new instance of the browser

4. Splitting Session Variable into several variables (array?)

5. Type mismatch when comparing session variable to page variable

6. Session variables in outlook

7. dotnet Session variable set too late - Error Page Description related

8. ASP.NET VB Session Variables

9. Converting Session Variable

10. hashtable in session variable

11. Global/Session variables

12. Can you early bind a session variable?

 

 
Powered by phpBB® Forum Software