Connect Progress Database via LSX

I want to connect Progress Database via LSX. Following is my code.I can create the connection and query the data successfully,but when trying insert data into the table(No matter use standard syntax : resultSet.AddRow and resultSet.SetValue and resultSet.UpdateRow or execute SQL statement directly),it occur a error 500.I try to indicate what the error code means from Lotus help,but fail.Is there anyone can kindly tell me what happen and give me solutions.Thanks in advance.

Option Public

Option Declare

Uselsx “*LSXODBC”

Sub Initialize

On Error GoTo errorHandler



Dim session As New NotesSession

Dim db As NotesDatabase

Set db=session.Currentdatabase

Dim con As New ODBCConnection

Dim qry As New ODBCQuery

Dim result As New ODBCResultSet

Call con.ConnectTo("DBPROGRESS","UserName","Password")

Dim sqltmp As String

Dim errorcode1 As Integer

Dim errorMessage1 As String

Dim extendedMessage1 As String



If Not con.IsConnected Then

	Messagebox "Could not connect to PROGRESS",,"No connection"

	Exit Sub

End If



Set qry.Connection=con

Set result.Query=qry



sqltmp$=|SELECT * FROM OWNER.TABLENAME|

qry.SQL=sqltmp$

result.Execute

If Not result.IsResultSetAvailable Then

	Messagebox "Couldn't get result set",, "No data"

	con.Disconnect

            Exit Sub	

End If



Call result.AddRow

Call result.SetValue("EMP_NO","AAA")

Call result.SetValue("EMP_NAME","BBB")

Call result.UpdateRow



result.Close(DB_CLOSE)

con.Disconnect

Exit sub

errorHandler:

errorcode1%=result.GetError

errorMessage1$=result.GetErrorMessage(errorcode1%)

extendedMessage1$=result.GetExtendedErrorMessage(errorcode1%)



Exit Sub

End Sub