Help somebody! Problem with LS:DO

Function ODBCResultSet.GetValue doesn’t working properly with string.I have Postgresql DB and I want get data from it using SQL query.

Dim connection As New ODBCConnection

Dim query As New ODBCQuery

Dim ResultSet As New ODBCResultSet

Dim v_UserName(10) As Variant

Dim i As Integer

b_Result = connection.ConnectTo(“PostgreSQL30W”)

Set query.Connection = connection

Set ResultSet.Query = query

query.SQL = {SELECT “UserName” FROM “USER_ACTIVITY”}

'//UserName is the column of “USER_ACTIVITY” table and it

'//has character varying data type.

If(ResultSet.IsResultSetAvailable) Then

i = 0 

Do

    ResultSet.nextrow



    v_UserName(i) = ResultSet.GetValue("UserName")

    '// GetValue return false

    '// ErrorMessage -  LS:DO- Cannot convert data from 

    '//native to expected or requested datatype



Loop Until ResultSet.IsEndOfData

End If

Call connection.Disconnect

'//With columns which have decimal or boolean datatype

'//function GetValue working properly

Subject: Help somebody! Problem with LS:DO

Try changing the code to:

ResultSet.GetValue(“USER_ACTIVITY”)

or

ResultSet.GetValue(1)

Cheers…