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. Database & SysAdmin
  3. Database
  4. ADO - SELECT statment

ADO - SELECT statment

Scheduled Pinned Locked Moved Database
questionc++help
3 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.
  • A Offline
    A Offline
    antonaras
    wrote on last edited by
    #1

    Hi buddies i have a relativly simple question i whant to exececute a select statment in c++ but for the WHERE part of the statment i want to read it from a variable of type string Let me be more precise. string token; token="SomeName" pCommand->CommandText = "SELECT * FROM Table1 WHERE Name=?";//WHERE Name=token Any ideas pls help Thanks again

    S 2 Replies Last reply
    0
    • A antonaras

      Hi buddies i have a relativly simple question i whant to exececute a select statment in c++ but for the WHERE part of the statment i want to read it from a variable of type string Let me be more precise. string token; token="SomeName" pCommand->CommandText = "SELECT * FROM Table1 WHERE Name=?";//WHERE Name=token Any ideas pls help Thanks again

      S Offline
      S Offline
      sathish s
      wrote on last edited by
      #2

      Like this pCommand->CommandText = "SELECT * FROM Table1 WHERE Name='" & token & "'" ;//WHERE Name=token

      1 Reply Last reply
      0
      • A antonaras

        Hi buddies i have a relativly simple question i whant to exececute a select statment in c++ but for the WHERE part of the statment i want to read it from a variable of type string Let me be more precise. string token; token="SomeName" pCommand->CommandText = "SELECT * FROM Table1 WHERE Name=?";//WHERE Name=token Any ideas pls help Thanks again

        S Offline
        S Offline
        sathish s
        wrote on last edited by
        #3

        string strsql; sprintf(strsql, "SELECT * FROM Table1 WHERE Name='%s'", token); pCommand->CommandText =strsql;

        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