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. Select statement to ADO control

Select statement to ADO control

Scheduled Pinned Locked Moved Visual Basic
database
7 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.
  • K Offline
    K Offline
    KARFER
    wrote on last edited by
    #1

    hi all I Add this tool "Microsoft ADO Data Control 6.0" and connected it to my Database and i want to store the select statment in my variable like this: dim dnsip as String dnsip = ado.RecordSource = "select ip1,ip2,ip3,ip4 from DNSTable where hostname like ('dnshostname ') " This code does not store select statment in my variable dnsip How i can store the select statment in variable dnsip THANK'S

    -*-*-*-*-*-*-*-*-* To Be Or Not To Be (KARFER) -*-*-*-*-*-*-*-*-*

    C M D 3 Replies Last reply
    0
    • K KARFER

      hi all I Add this tool "Microsoft ADO Data Control 6.0" and connected it to my Database and i want to store the select statment in my variable like this: dim dnsip as String dnsip = ado.RecordSource = "select ip1,ip2,ip3,ip4 from DNSTable where hostname like ('dnshostname ') " This code does not store select statment in my variable dnsip How i can store the select statment in variable dnsip THANK'S

      -*-*-*-*-*-*-*-*-* To Be Or Not To Be (KARFER) -*-*-*-*-*-*-*-*-*

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I dunno how VB handles this sort of syntax, why not set dnsip first, THEN set teh RecordSource on the next line ?

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • K KARFER

        hi all I Add this tool "Microsoft ADO Data Control 6.0" and connected it to my Database and i want to store the select statment in my variable like this: dim dnsip as String dnsip = ado.RecordSource = "select ip1,ip2,ip3,ip4 from DNSTable where hostname like ('dnshostname ') " This code does not store select statment in my variable dnsip How i can store the select statment in variable dnsip THANK'S

        -*-*-*-*-*-*-*-*-* To Be Or Not To Be (KARFER) -*-*-*-*-*-*-*-*-*

        M Offline
        M Offline
        MikeMarq
        wrote on last edited by
        #3

        I'm not much of an expert on ado but I can see at least one thing is wrong here. You have 2 equals statements which I think is illegal. Either your first " should be between your = and ado.Recordsource if you are trying to turn that whole statement into a string or you should do this in 2 lines of code if you are trying to make 2 assignments.

        1 Reply Last reply
        0
        • K KARFER

          hi all I Add this tool "Microsoft ADO Data Control 6.0" and connected it to my Database and i want to store the select statment in my variable like this: dim dnsip as String dnsip = ado.RecordSource = "select ip1,ip2,ip3,ip4 from DNSTable where hostname like ('dnshostname ') " This code does not store select statment in my variable dnsip How i can store the select statment in variable dnsip THANK'S

          -*-*-*-*-*-*-*-*-* To Be Or Not To Be (KARFER) -*-*-*-*-*-*-*-*-*

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Seriously, pickup a beginners book on VB.NET and work through it. What you're doing is legal, but that statement doesn't work how you're thinking it does.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          C 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Seriously, pickup a beginners book on VB.NET and work through it. What you're doing is legal, but that statement doesn't work how you're thinking it does.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            No, he'd rather ask the same question again..... ( about 3 threads up )

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            D 1 Reply Last reply
            0
            • C Christian Graus

              No, he'd rather ask the same question again..... ( about 3 threads up )

              Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Christian Graus wrote:

              No, he'd rather ask the same question again.....

              :sigh: Why do we even bother...

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              C 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Christian Graus wrote:

                No, he'd rather ask the same question again.....

                :sigh: Why do we even bother...

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                For the few who listen....

                Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                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