|
 |
asp_web_howto thread: empty recordset
Message #1 by kayandipo@h... on Fri, 21 Dec 2001 16:58:13
|
|
If Request("_cluesplease") = Request("_cluesplease2") Then
' Generate random salt (10 characters)
Randomize
Salt = ""
For i = 1 to 10
Salt = Salt & chr(int(Rnd * 26) + 65) '65 is ASCII for "A"
Next
' Calculate Hash of Password + Salt
Set CM1 = Server.CreateObject("Persits.CryptoManager")
Set Context1 = CM1.OpenContext("mycontainer", True)
Set Hash1 = Context1.CreateHash
Hash1.AddText Request.Form("_cluesplease") & Salt
HashValue = Hash1.Value.Hex
sql=WebDbPath & ".add_new_user '" & TRIM(Request.Form("_user_name"))
sql=sql & "','" & "contact1"
sql=sql & "','" & TRIM(Request.Form("_user_id"))
sql=sql & "','" & TRIM(HashValue)
sql=sql & "','" & TRIM(Request.Form("_email"))
sql=sql & "','" & TRIM(Request.Form("_phone"))
sql=sql & "','" & "fax1"
sql=sql & "','" & Request.Form("_Address1")
sql=sql & "','" & Request.Form("_Address2")
sql=sql & "','" & strpad(Request.Form("_Address3"),1," ")
sql=sql & "','" & strpad(Request.Form("_Address4"),1," ")
sql=sql & "','" & Request.Form("_PC")
sql=sql & "','UK'"
If Request.Form("_rcv_mkt_mat") = "ON" Then
sql=sql & ",'N'"
Else
sql=sql & ",'Y'"
End if
sql=sql & ",'" & TRIM(Request.Form("_reminder_question"))
sql=sql & "','" & TRIM(Request.Form("_reminder_answer")) & "','"
sql=sql & TRIM(Request.Form("_current_user_link")) & "'"
sql=sql & ",'WWW001'"
sql=sql & ",'PUKH'"
sql=sql & ",'" & TRIM(salt) & "'"
'if Session_Debug_Level > 0 then
'Response.Write(sql&"<br>")
'Response.End
'End if
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open sql,Conn
'Response.Write(sql)&"<BR>"
'if Err.Number <> 0 Then
' OnError Conn,""
' Response.End
'End If
End if 'Request("_cluesplease") = Request("_cluesplease2")
if Len (RS(0))= 0 then
Response.Write rs.source&"<BR>"
Dear all,
above is my code could someone please help and spot why my rs=0
(if Len (RS(0))= 0 then)
Message #2 by "TomMallard" <mallard@s...> on Fri, 21 Dec 2001 09:59:59 -0800
|
|
If RS(0) is empty or null, it's length will be zero. Have you run the sql in
query analyzer to see what the first field value is?
tom mallard
seattle
----- Original Message -----
From: <kayandipo@h...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Friday, December 21, 2001 4:58 PM
Subject: [asp_web_howto] empty recordset
> If Request("_cluesplease") = Request("_cluesplease2") Then
> ' Generate random salt (10 characters)
> Randomize
> Salt = ""
> For i = 1 to 10
> Salt = Salt & chr(int(Rnd * 26) + 65) '65 is ASCII for "A"
> Next
>
> ' Calculate Hash of Password + Salt
> Set CM1 = Server.CreateObject("Persits.CryptoManager")
> Set Context1 = CM1.OpenContext("mycontainer", True)
> Set Hash1 = Context1.CreateHash
> Hash1.AddText Request.Form("_cluesplease") & Salt
> HashValue = Hash1.Value.Hex
>
> sql=WebDbPath & ".add_new_user '" & TRIM(Request.Form("_user_name"))
> sql=sql & "','" & "contact1"
> sql=sql & "','" & TRIM(Request.Form("_user_id"))
> sql=sql & "','" & TRIM(HashValue)
> sql=sql & "','" & TRIM(Request.Form("_email"))
> sql=sql & "','" & TRIM(Request.Form("_phone"))
> sql=sql & "','" & "fax1"
> sql=sql & "','" & Request.Form("_Address1")
> sql=sql & "','" & Request.Form("_Address2")
> sql=sql & "','" & strpad(Request.Form("_Address3"),1," ")
> sql=sql & "','" & strpad(Request.Form("_Address4"),1," ")
> sql=sql & "','" & Request.Form("_PC")
> sql=sql & "','UK'"
> If Request.Form("_rcv_mkt_mat") = "ON" Then
> sql=sql & ",'N'"
> Else
> sql=sql & ",'Y'"
> End if
> sql=sql & ",'" & TRIM(Request.Form("_reminder_question"))
> sql=sql & "','" & TRIM(Request.Form("_reminder_answer")) & "','"
> sql=sql & TRIM(Request.Form("_current_user_link")) & "'"
> sql=sql & ",'WWW001'"
> sql=sql & ",'PUKH'"
> sql=sql & ",'" & TRIM(salt) & "'"
>
> 'if Session_Debug_Level > 0 then
> 'Response.Write(sql&"<br>")
> 'Response.End
> 'End if
>
>
> Set RS = Server.CreateObject("ADODB.Recordset")
> RS.Open sql,Conn
> 'Response.Write(sql)&"<BR>"
> 'if Err.Number <> 0 Then
> ' OnError Conn,""
> ' Response.End
> 'End If
> End if 'Request("_cluesplease") = Request("_cluesplease2")
> if Len (RS(0))= 0 then
> Response.Write rs.source&"<BR>"
>
> Dear all,
> above is my code could someone please help and spot why my rs=0
> (if Len (RS(0))= 0 then)
>
$subst('Email.Unsub').
>
|
|
 |