Re: Session variables

by "Michael Gerholdt" <gerholdt(at)fredonia.edu>

 Date:  Sat, 23 Dec 2000 21:52:30 -0500
 To:  "Susan Walsh" <susan(at)equilibriumdesign.com>,
"Cyanide _7" <leo7278(at)hotmail.com>,
<hwg-languages(at)hwg.org>
 References:  equilibriumdesign
  todo: View Thread, Original
Susan,

Apparently no records are being retrieved, so there is no recordset.

I have some suggestions which may not be 'the answer' to the problem but
they may  help.

first:

put values into variables and use variables in the SQL string.

For dealing with the singlequote set a constant
easier to read/debug for errors

const sqout = "'"

strCustPwd = "Replace(rsLoginPswd__strCustomerID, strquot, strquot &
strquot)
strLoginPIN = "Replace(rsLoginPswd__strPIN, strquot, strquot & strquot)

(The plus sign is for adding, not concatenating strings. Use the ampersand.
The plus sign will sometimes work for concatenating depending on the
vartype, but that's not what it is for.)

 rsLoginPswd.Source = "SELECT *  FROM Customers  WHERE CustomerID='" &
strCustPwd & "' AND PIN='" & strLoginPIN & "'"

again, this sql string is easier for human reading and so easier to debug.

as a test,

response.write strCustPwd & " " & strLoginPIN & "<BR>"

just to make sure they are being populated as you wish

and

response.write rsLoginPswd.Source & "<BR>"

and see that the sql is in proper form.

Do these response.writes BEFORE you try to write any possible results from
the recordset and they will appear
if you try to write from a recordset that is not there (i.e., is empty),
then the script stops and you won't be able to read these.

If your query works with data hard-coded but not when you try to use
variables, then the questions are:
- do the variables have content
- if so, is it content that matches what is in the db
- am I passing the content correctly

if the answer to all these is yes, then an attempt to return a recordset
with the variables should be every bit as successful as one which is
hardcoded.

luck
Michael


you also wrote

<form name="login" method="post" action="loginPrac.asp">
Customer ID:
 <input type="text" name="CustomerID">
<p>Customer Code:
<input type="text" name="PIN">
<p>
<input type="submit" value="Submit">


How do I pass the variable to the next page.  I have been testing with a
Request.Form("CustomerID") on the subsequent page, but nothing is passing.
Any ideas?

as a test on the "loginPrac.asp" page

for each key in request.form
 response.write key & " = " & request.form(key) & "<BR>"
next

this will show you exactly what is coming across in request.form
put it at the top of the page before running any operations and see what is
there.

in your example above i had to add back in the '<' by the "submit" button ??

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA