I'm trying to figure out how this code works because its from VB6 and I am converting it to VB.NET, The previous developer of this program told me that the lstrvalue is an SQL code but I don't see any common statement like SELECT, UPDATE, etc. that is why I don't understand it.
rs.Open "Select AccountCode,rtrim(type) as type, rtrim(left(formula,3)) as bet1,ltrim(right(formula,3))as bet2 from vwTempTableWP where rtrim(type) in('SUM','+','-') order by orderby", con
If rs.EOF Then
Else
rs.MoveFirst
Do While rs.EOF <> True
codetype = Trim(rs!AccountCode)
tipo = Trim(rs!Type)
bet1 = CDbl(Trim(rs!bet1))
bet2 = CDbl(Trim(rs!bet2))
If tipo = "SUM" Then
lstrValue = "execute sp_sum '" & Trim(codetype) & "','Working'," & CDbl(bet1) & "," & CDbl(bet2) & ""
con.Execute lstrValue
'Do While con.State = adStateExecuting
'Loop
ElseIf tipo = "+" Then
lstrValue = "execute sp_add '" & Trim(codetype) & "','" & Trim(report) & "'," & CDbl(bet1) & "," & CDbl(bet2) & ""
con.Execute lstrValue
'Do While con.State = adStateExecuting
'Loop
ElseIf tipo = "-" Then
lstrValue = "execute sp_minus '" & Trim(codetype) & "','" & Trim(report) & "'," & CDbl(bet1) & "," & CDbl(bet2) & ""
con.Execute lstrValue
'Do While con.State = adStateExecuting
'Loop
End If
rs.MoveNext
Loop
rs.Close
End If
rs is defined as new
ADODB.Recordsetcon is defined as new
ADODB.Connection