SQL addrow negative result!

Hi all,

i have a strange problem when writing data from Lotus into a SQL table.

Every time i execute the script it will identify correctly the last row of the SQL table.

But when it passes the “result.addrow”, the value of the “current row” is turning from the correct value into a negative number (always “-3”).

I’m desperate… Could anyone help please ? Thank you.

Here is my script:

Sub Initialize

Set s = New NotesSession 

Set db = s.CurrentDatabase 

Set agent = s.CurrentAgent 

Set agentLog = New NotesLog(agent.Name)

Call agentLog.OpenAgentLog()	



Set odbcConn = New ODBCConnection

If Not odbcConn.ConnectTo(dsnName, dsnUser, dsnPwd) Then

	Call agentLog.LogAction("Could not connect to " + dsnName + ": " +  odbcConn.GetErrorMessage())

	Call agentLog.LogAction("Extended error information: " + odbcConn.GetExtendedErrorMessage)

	Exit Sub

End If



Dim qry As ODBCQuery

Set qry = New ODBCQuery

Set qry.Connection = odbcConn

qry.SQL = "SELECT * from Import"	

Dim result As ODBCResultSet

Set result = New ODBCResultSet

Set result.Query = qry

result.Execute	

result.lastrow

result.addrow

Best regards,

Oliver