I need to grab three values from a table and store them into variables. I have tried a few variation of the following but am not getting what I need.
Any suggestions?
Is what I am trying to do the correct way of doing this?
Thanks,
Chilly442
Code:
Try
Con.Open()
Dim sql As New StringBuilder(1024)
Dim objcmd As New OdbcCommand(sql.ToString, Con)
sql.Append("SELECT EFOR, EAF, PEA INTO MyEFOR, MyEAF, MyPEA FROM History WHERE Unit = ('" & UnitText & "')")
objcmd = New OdbcCommand(sql.ToString, Con)
Value = objcmd.ExecuteScalar()
Con.Close()
Catch ex As Exception
MsgResult = MsgBox("Unable to connect. " & ex.Message)
End Try
Any suggestions?
Is what I am trying to do the correct way of doing this?
Thanks,
Chilly442