Give me a gun pliz
-
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 formPrivate 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
-
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 formPrivate 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
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[^]
-
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 formPrivate 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
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." -
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."He could always move on to VB6's offspring. It has already surpassed its parent!
ROFLOLMFAO
-
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."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.
-
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.
-
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.
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
-
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.
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