Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - comparing strings
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

comparing strings

 Post Reply Post Reply
Author
CyberBless View Drop Down
Newbie
Newbie


Joined: 04 August 2003
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote CyberBless Quote  Post ReplyReply Direct Link To This Post Topic: comparing strings
    Posted: 04 August 2003 at 8:51pm

I'm trying to compare two strings.  One is an imput from a form the other comes from a record source from a SQL 2000 database.  Here is where I am stuck. 

 

  if request.Form("formVariable") = rs("rsvariable") then
       code code

  end if

 

Is it possible to do it like this.  If not what are my alternatives.  Any help would be appreciated. 

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2003 at 9:02pm
There is also the strComp function.
strComp Information @ Microsoft
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2003 at 9:16pm

what about something like this:

Dim var1, var2

var1 = Request.Form("formVariable")
var2 = rs("rsVariable")

IF var1 = var2 THEN
...code here....
END IF

Back to Top
CyberBless View Drop Down
Newbie
Newbie


Joined: 04 August 2003
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote CyberBless Quote  Post ReplyReply Direct Link To This Post Posted: 06 August 2003 at 7:50am

ljamal,

     That strComp did the trick, thank you.  I knew there was a function that would do it I just didn't know what it was.  It's nice to see that MSDN is worth something.  I think I'll use it more often. 

Thanks again

Cyber "the mad scientist"

Back to Top
CyberBless View Drop Down
Newbie
Newbie


Joined: 04 August 2003
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote CyberBless Quote  Post ReplyReply Direct Link To This Post Posted: 06 August 2003 at 7:53am

KCWebMonkey,

     what you suggested would not give me the results I wanted.  It compared the strings but paid no attention to uppercase or lowercase.  The strComp is what I was looking for.

Thanks though,

Cyber "the mad scientist"

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.