Hi,
I have the following code for retrieving values from an ODBC connection and assigning these values to a field on a form. Part of my code is as follows. I am having trouble getting the actual values from the result set of the query.
Sub Click(Source As Button)
Dim con As ODBCConnection
Dim qry As ODBCQuery
Dim result As ODBCResultSet
Dim msg As String
Dim pername As String
Set con = New ODBCConnection
Set qry = New ODBCQuery
Set result = New ODBCResultSet
Set qry.Connection = con
Set result.Query = qry
con.ConnectTo("myodbc")
msg = "SELECT perid, last_name FROM person_name WHERE perid = " + pernum
qry.SQL = msg
result.Execute
result.NextRow
pername = result.FieldName(last_name)
Messagebox " The Last Name is "+ pername
End Sub