Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JUST AN ACCESS SELECT STATEMENT

JUST AN ACCESS SELECT STATEMENT

Scheduled Pinned Locked Moved Web Development
databasequestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    evlxtc
    wrote on last edited by
    #1

    response.write(Searchvar) SQL = "SELECT * FROM MYDB WHERE DESCRIPTION LIKE '*"Searchvar"*'" The response.write(Searchvar) returns the correct text i.e. ARTICLE BUT my SQL statement returns the FULL DB every time? Where is my SELECT statement going wrong? Just wnat to limit the result to all records with the string ARTICLE in the DESCRIPTION TABLE. i.e. IF the field is "THIS ARTICLE IS BLUE" it should display that record this is me

    G 1 Reply Last reply
    0
    • E evlxtc

      response.write(Searchvar) SQL = "SELECT * FROM MYDB WHERE DESCRIPTION LIKE '*"Searchvar"*'" The response.write(Searchvar) returns the correct text i.e. ARTICLE BUT my SQL statement returns the FULL DB every time? Where is my SELECT statement going wrong? Just wnat to limit the result to all records with the string ARTICLE in the DESCRIPTION TABLE. i.e. IF the field is "THIS ARTICLE IS BLUE" it should display that record this is me

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Are you really sure that this code is runnable at all? You really should get a syntax error trying to run it. You have forgotten the & operator for concatenating the strings: SQL = "SELECT * FROM MYDB WHERE DESCRIPTION LIKE '*" & Searchvar & "*'" --- b { font-weight: normal; }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups