Simple control structure...

Results 1 to 2 of 2

Thread: Simple control structure...

  1. #1
    Join Date
    Dec 1969

    Default Simple control structure...

    What is the correct code for the following commented lines? I want to redirect anyway even if the variable is incorrect, but<BR> If not (rs.BOF and rs.EOF) then... will not work for me!<BR><BR> strSQL = "Select * from Affiliates Where ID=" & ID<BR> Set rs = Server.CreateObject("ADODB.Recordset")<BR> rs.CursorType = adOpenStatic<BR> rs.LockType = adLockOptimistic<BR> rs.Open strSQL, MyConnection<BR> <BR> &#039;if this is a valid ID then<BR> <BR> rs("Clickthrus") = rs("Clickthrus") + 1<BR> rs.Update<BR> <BR> Session("affiliate")=ID<BR> Response.Redirect("register.asp")<BR> <BR> &#039;else redirect anyway<BR><BR>Thanks in advance for newbie tolerance...

  2. #2
    Join Date
    Dec 1969

    Default RE: Simple control structure...

    so you WANT to verify if ID is valid..<BR>well if its a NUMERIC then...something like..<BR><BR>if len(id) &#062; 0 and typename(id) = "integer" then<BR><BR>rs("Clickthrus") = rs("Clickthrus") + 1<BR>rs.Update<BR><BR>Session("affiliate")=ID<BR>R esponse.Redirect("register.asp")<BR><BR>else<BR><B R>Response.Redirect("/homepage.asp")<BR><BR><BR>end if<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts