'LIKE' keyword

Results 1 to 3 of 3

Thread: 'LIKE' keyword

  1. #1
    Baby Gerl Guest

    Default 'LIKE' keyword

    Hi all,<BR><BR>How do I use a LIKE operator in Vbscript? What I need to check for is whether the customer name input is something like the one inside the database...so what I did is this..<BR><BR>if custnameValue like rs("Cust_name") = true then<BR> ...<BR><BR>The error msg seems to say that sub or function function<BR>not defined and it points to the above statement. Any idea?...<BR>pls adv...thanks..

  2. #2
    Join Date
    Dec 1969

    Default Can't do that

    Are you wanting to see if the substring custnameValue exists within rs("Cust_Name") or are you wanting to see if custnameValue EQUALS rs("Cust_Name") value, exactly?<BR><BR>To do the former, use InStr. See:<BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=17<BR><BR>If you are wanting to see if these two values are exactly equal, use the following code:<BR><BR>If CStr(custnameValue) = CStr(rs("Cust_Name").Value) then ...<BR><BR>Happy Programming!

  3. #3
    Baby Gerl Guest

    Default RE: Can't do that

    Hi Scott,<BR><BR>Actually I want the former .<BR>But I was wondering if i do like this <BR>instr(1,"Technology","Singapore technology",1)<BR>- Technology being the string I want to search in and<BR>- Singapore technology is string to search for<BR>so the result is it founded or not?...<BR>To me it should return a position..Pls adv..<BR>thanks a lot...:)

Posting Permissions

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