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. General Programming
  3. Visual Basic
  4. Problem in Sql Command

Problem in Sql Command

Scheduled Pinned Locked Moved Visual Basic
helpdatabase
5 Posts 4 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.
  • S Offline
    S Offline
    sriwirko
    wrote on last edited by
    #1

    Dear all Dim ProductAdapter As New OleDb.OleDbDataAdapter( _ "SELECT * FROM TCAP WHERE NTCIDCODE LIKE 'VARIABLE' ", _ sConn) ====================================================== I has a ploblem with VARIABLE String. i want to declare variable and replace than VARIABLE Exam : Public const strTest As string = "TEST" i 'm cannot declare strTest variable in sql command like that. Please help and advise me. Many thaks & best regards sriwirko

    U J 2 Replies Last reply
    0
    • S sriwirko

      Dear all Dim ProductAdapter As New OleDb.OleDbDataAdapter( _ "SELECT * FROM TCAP WHERE NTCIDCODE LIKE 'VARIABLE' ", _ sConn) ====================================================== I has a ploblem with VARIABLE String. i want to declare variable and replace than VARIABLE Exam : Public const strTest As string = "TEST" i 'm cannot declare strTest variable in sql command like that. Please help and advise me. Many thaks & best regards sriwirko

      U Offline
      U Offline
      User 1305173
      wrote on last edited by
      #2

      Declare a variable like strVariable and replace VARIABLE with strVariable but without the single quote. :laugh: Luckyhuss

      S 1 Reply Last reply
      0
      • U User 1305173

        Declare a variable like strVariable and replace VARIABLE with strVariable but without the single quote. :laugh: Luckyhuss

        S Offline
        S Offline
        sriwirko
        wrote on last edited by
        #3

        thank for you advance sriwirko

        1 Reply Last reply
        0
        • S sriwirko

          Dear all Dim ProductAdapter As New OleDb.OleDbDataAdapter( _ "SELECT * FROM TCAP WHERE NTCIDCODE LIKE 'VARIABLE' ", _ sConn) ====================================================== I has a ploblem with VARIABLE String. i want to declare variable and replace than VARIABLE Exam : Public const strTest As string = "TEST" i 'm cannot declare strTest variable in sql command like that. Please help and advise me. Many thaks & best regards sriwirko

          J Offline
          J Offline
          Just Greeky Creek
          wrote on last edited by
          #4

          USE Public const strTest As string = "TEST" Dim ProductAdapter As New OleDb.OleDbDataAdapter( _ "SELECT * FROM TCAP WHERE NTCIDCODE LIKE '" & strTest & "' ", _ sConn)

          A 1 Reply Last reply
          0
          • J Just Greeky Creek

            USE Public const strTest As string = "TEST" Dim ProductAdapter As New OleDb.OleDbDataAdapter( _ "SELECT * FROM TCAP WHERE NTCIDCODE LIKE '" & strTest & "' ", _ sConn)

            A Offline
            A Offline
            Anonymous
            wrote on last edited by
            #5

            Thank you very much guy

            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