Results 1 to 4 of 4

Thread: Compare texts strings in VB.NET from Access mdb

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2003
    Posts
    219

    Question Compare texts strings in VB.NET from Access mdb

    Is there a way I can compare texts strings enter from a user at run time to an Access mdb field declared as memo? If there is a way, would anyone share it with me? The texts typed from a user at run time are from a text box compare to a SQL query from the Access mdb file. If that is not possible, please suggest another way that the comparison can be done with a more relaxed comparison. I have used the operator "=" and it is too strict and exact.

    Please help if anyone have an idea.

    Many thanks in advance!

    Chong

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try this example . It returns non-zero value if strings being compared aren't alike and zero whey they are .
    It compares :spaces , upper and lower cases ...etc . It looks simple but does the job efficiently
    VB Code:
    1. Dim str1 As String = "abc"
    2.         Dim str2 As String = "ABC"
    3.         Dim RESULT As String = String.Compare(str1, str2)
    4.         MsgBox(RESULT)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2003
    Posts
    219

    Question

    Thanks for reponding to my request. However, I'm afraid the code you gave me would be too precise. I want a more relaxed comparison. Another word, the comparison would not compare spaces, upper or lower cases etc.. In addition, I planned to compare maybe a phrase or just a word from the user to a memo text field in the database which could be more than one or two paragraphs of texts. For example, I want to compare 4H Club to a memo of texts field that has over two thousand of characters. And if any word or phrase in this text field matches the word typed by the user, then give me a true result or something like that.

    Chong

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    This demo applies on single words (not phrases) . As I said it checks for all differences between both words and return nonzero value if not similar .try it out 1
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width