Any access db /vbscript experts out there?

Discussion in 'C#' started by grobar, Jun 8, 2006.

  1. #1
    using ms acess db to store articles.

    Developing a search page using an SQL "like" statement, but geting no results found.

    if I use an "=" in place of the like, and set a definite search param like

    select * FROM table where RFID = 1

    this will work perfectly.

    BUT

    If i say

    select * FROM table where RFID LIKE 1

    any suggestions?

    I was thinking its either a recordset cursor issue, OR, some setting in the access DB is off.
     
    grobar, Jun 8, 2006 IP
  2. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you need % for like. it's an sql wildcard. % before is wild before, % after is wild after, so surround your search string with % on both sides to make it work.
     
    vectorgraphx, Jun 8, 2006 IP
  3. dodolls

    dodolls Well-Known Member

    Messages:
    282
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    select *from table where RFID like '%1%';


    syntax when using like.
     
    dodolls, Jun 8, 2006 IP
  4. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    looks like he's querying a numeric field so he wouldn't use the apostrophes.
     
    vectorgraphx, Jun 9, 2006 IP
  5. grobar

    grobar Well-Known Member

    Messages:
    642
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    140
    #5
    sorry guys, it IS a txt fields, that was used for sake of simplicity in the example.....

    I think the % blah % will do it. I KNEW that, but must have overlooked it. Thanks for all your help, and i'll post back with the results later today when I test it at the office.

    thanks!
     
    grobar, Jun 9, 2006 IP
  6. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #6
    cool - good luck :)

    VG
     
    vectorgraphx, Jun 9, 2006 IP
  7. dodolls

    dodolls Well-Known Member

    Messages:
    282
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #7
    good luck.
     
    dodolls, Jun 9, 2006 IP
  8. aakainfo

    aakainfo Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hi i am new service provider.
     
    aakainfo, Jun 10, 2006 IP