if...then troubles!

Results 1 to 2 of 2

Thread: if...then troubles!

  1. #1
    glen Guest

    Default if...then troubles!

    I have a variable that i pulled from a querystring and another variable from a Connection like this:<BR><BR>intLink=Request.Querystring("LINK")<B R><BR>set check=Server.CreateObject("ADODB.Connection")<BR> check.Open strConn<BR> set gr=check.execute("SELECT * FROM tblPSubs WHERE tblPSubs.fkPeopleID="&Session("dbcurKey"))<BR><BR> Then I do this:<BR><BR>Do while NOT gr.eof<BR> if intLink=gr(2) Then<BR> Response.Redirect("home.asp")<BR> end if<BR> gr.Movenext<BR>Loop<BR><BR>Here&#039s the problem that&#039s driving me CRAZY!! Even though the data is equal (i&#039ve checked it over and over and over. ....), this condition is not true. In other words, it is NOT redirecting! It will however, redirect if I make the statement look like this: <BR><BR>intLink&#060;&#062;gr(2) <BR><BR>This doesn&#039t make sense. Has anyone seen this?<BR><BR>

  2. #2
    Steve Cimino Guest

    Default RE: if...then troubles!

    You&#039re comparing string data versus numeric data.. do this<BR><BR>If CLng(intLink) = CLng(gr(2)) Then<BR><BR>Then 2 = 2<BR><BR>What you are trying to do is<BR>"2" = 2<BR>which is most definately false.

Posting Permissions

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