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. Other Discussions
  3. The Weird and The Wonderful
  4. Give me a gun pliz

Give me a gun pliz

Scheduled Pinned Locked Moved The Weird and The Wonderful
question
8 Posts 8 Posters 2 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.
  • D Offline
    D Offline
    DoomedOne
    wrote on last edited by
    #1

    Hi, I found this code in an old VB6 app that we need to "upgrade" (in fact replace with a new one be a much better approach, but...) cbo_Caminos is a ComboBox, o_rs is defined as ADODB.Recordset If CInt(Trim(Mid(cbo_Caminos.Text, 151, 6))) = CInt(o_Rs.Fields("NroCamino")) Then .... 'do something End If And yes o_Rs.Fields("NroCamino") is an integer Why not use ItemData of the combobox to store de integer value associated whit the content of the combobox text? :confused: More on the same form Private Sub .......() Dim o_rs As New ADODB.Recordset Dim s_Sql As String s_Sql = "" s_Sql = "Select * from ......" Set o_rs = New ADODB.Recordset Set o_rs = DBConnect.Execute(s_Sql) ..... ..... If mAutmoatico Then ' mAutmoatico is boolean defined as global var s_Sql = "" s_Sql = "Select ..... s_Sql = s_Sql & "From ...." s_Sql = "Where ...." set o_rs = DBConnect.Execute(s_Sql) .... End If For some miraculous reason mAutmoatico is always false when reach the above If Enjoy.

    Habetis bona deum

    C L 2 Replies Last reply
    0
    • D DoomedOne

      Hi, I found this code in an old VB6 app that we need to "upgrade" (in fact replace with a new one be a much better approach, but...) cbo_Caminos is a ComboBox, o_rs is defined as ADODB.Recordset If CInt(Trim(Mid(cbo_Caminos.Text, 151, 6))) = CInt(o_Rs.Fields("NroCamino")) Then .... 'do something End If And yes o_Rs.Fields("NroCamino") is an integer Why not use ItemData of the combobox to store de integer value associated whit the content of the combobox text? :confused: More on the same form Private Sub .......() Dim o_rs As New ADODB.Recordset Dim s_Sql As String s_Sql = "" s_Sql = "Select * from ......" Set o_rs = New ADODB.Recordset Set o_rs = DBConnect.Execute(s_Sql) ..... ..... If mAutmoatico Then ' mAutmoatico is boolean defined as global var s_Sql = "" s_Sql = "Select ..... s_Sql = s_Sql & "From ...." s_Sql = "Where ...." set o_rs = DBConnect.Execute(s_Sql) .... End If For some miraculous reason mAutmoatico is always false when reach the above If Enjoy.

      Habetis bona deum

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      DoomedOne wrote:

      For some miraculous reason mAutmoatico is always false when reach the above If

      Good thing, too. 'Cause I don't think the sql is going to work very well. It will only have a where clause in it. :doh:

      Chris Meech I am Canadian. [heard in a local bar] Donate to help Conquer Cancer[^]

      1 Reply Last reply
      0
      • D DoomedOne

        Hi, I found this code in an old VB6 app that we need to "upgrade" (in fact replace with a new one be a much better approach, but...) cbo_Caminos is a ComboBox, o_rs is defined as ADODB.Recordset If CInt(Trim(Mid(cbo_Caminos.Text, 151, 6))) = CInt(o_Rs.Fields("NroCamino")) Then .... 'do something End If And yes o_Rs.Fields("NroCamino") is an integer Why not use ItemData of the combobox to store de integer value associated whit the content of the combobox text? :confused: More on the same form Private Sub .......() Dim o_rs As New ADODB.Recordset Dim s_Sql As String s_Sql = "" s_Sql = "Select * from ......" Set o_rs = New ADODB.Recordset Set o_rs = DBConnect.Execute(s_Sql) ..... ..... If mAutmoatico Then ' mAutmoatico is boolean defined as global var s_Sql = "" s_Sql = "Select ..... s_Sql = s_Sql & "From ...." s_Sql = "Where ...." set o_rs = DBConnect.Execute(s_Sql) .... End If For some miraculous reason mAutmoatico is always false when reach the above If Enjoy.

        Habetis bona deum

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        DoomedOne wrote:

        old VB6 app that we need to "upgrade"

        I dont think VB6 has an upgrade path :)

        xacc.ide
        IronScheme a R5RS-compliant Scheme on the DLR
        The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

        R P 2 Replies Last reply
        0
        • L leppie

          DoomedOne wrote:

          old VB6 app that we need to "upgrade"

          I dont think VB6 has an upgrade path :)

          xacc.ide
          IronScheme a R5RS-compliant Scheme on the DLR
          The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

          R Offline
          R Offline
          Ri Qen Sin
          wrote on last edited by
          #4

          He could always move on to VB6's offspring. It has already surpassed its parent!

          ROFLOLMFAO

          1 Reply Last reply
          0
          • L leppie

            DoomedOne wrote:

            old VB6 app that we need to "upgrade"

            I dont think VB6 has an upgrade path :)

            xacc.ide
            IronScheme a R5RS-compliant Scheme on the DLR
            The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            leppie wrote:

            I dont think VB6 has an upgrade path

            Yes it has - it's called the Recycle Bin.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            P P V 3 Replies Last reply
            0
            • P Pete OHanlon

              leppie wrote:

              I dont think VB6 has an upgrade path

              Yes it has - it's called the Recycle Bin.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              P Offline
              P Offline
              PeterMB
              wrote on last edited by
              #6

              Nice one

              1 Reply Last reply
              0
              • P Pete OHanlon

                leppie wrote:

                I dont think VB6 has an upgrade path

                Yes it has - it's called the Recycle Bin.

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                P Offline
                P Offline
                Paul Conrad
                wrote on last edited by
                #7

                Pete O'Hanlon wrote:

                I dont think VB6 has an upgrade path Yes it has - it's called the Recycle Bin.

                :laugh::laugh::laugh: Sweet :)

                "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                1 Reply Last reply
                0
                • P Pete OHanlon

                  leppie wrote:

                  I dont think VB6 has an upgrade path

                  Yes it has - it's called the Recycle Bin.

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  V Offline
                  V Offline
                  Vasudevan Deepak Kumar
                  wrote on last edited by
                  #8

                  Impeccable, Unfailing, Trusted Upgradepath for VB. :)

                  Vasudevan Deepak Kumar Personal Homepage
                  Tech Gossips
                  A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

                  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