Strings not matching

Results 1 to 2 of 2

Thread: Strings not matching

  1. #1
    Join Date
    Dec 1969

    Default Strings not matching

    I am having two problems. 1st, I set up a database with user accounts. When they set up the account, they get assigned a unique ID. I send an email to their address with ID in it, but the URL is too long and half of it goes on the next line, so the URL will not work if they click it. Only the half on the first line goes to the browser when they click. The other question has to do with this also. I do a compare against the data in that query string that is sent back to the web site. I then compare the ID with that in the DB and I cannot get it to compare even though they are equal. Here is the code that I use to compare:<BR><BR>IF objRec.Fields("UniqueValID") = UniqueValID then<BR> ....<BR><BR>This never works, but this does:<BR><BR>Response.Write(strComp(objRec.Fields( "UniqueValID"),UniqueValID))<BR><BR>This code will return a 0 which means they match... What am I doing wrong or assuming in the IF statement? Also any help on getting that URL to stay on one line would be great.<BR><BR>TIA<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Strings not matching

    That&#039s because objRec.Fields("UniqueValId") is really a collection with tons of properties and such. It *should* use the .Value property be default, however I have had problems with this. So, either do this:<BR><BR>IF objRec.Fields("UniqueValID").Value = UniqueValID then<BR><BR>or<BR><BR>&#039Cast it to a string<BR>IF CString(objRec.Fields("UniqueValID")) = UniqueValID then<BR><BR>Happy Programming!<BR><BR><BR><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