INSERT values in SQL database

Hi,

i try to insert some ItemValues in a SQL Server 2005 database. I got some trouble with it…

Here is my relevant code:

##################################################

Dim con As New ODBCConnection

Dim qry As New ODBCQuery

Dim result As New ODBCResultSet

'##### INSERT #####

	' Connection-Object linked with a Query

	Set qry.Connection = con

	' Connection-Object linked with a ResultSet before getting results

	Set result.Query = qry

	Call con.ConnectTo("myUserDSN","sa","secret")

	If (con.IsConnected) Then

		Print "Connected to DB... DSN=" & con.DataSourceName

		

		qry.SQL = "SELECT * FROM Task"

		'result.cachelimit = DB_NONE

		' ausführen der Query

		result.Execute

		If result.IsResultSetAvailable Then

			result.LastRow

			result.AddRow

			Call result.SetValue("GlobalObjectId",GlobalObjectId)

			Call result.SetValue("Subject",subject)

			Call result.SetValue("StartDate",startDate.LSLocalTime)

			Call result.SetValue("DueDate",dueDate.LSLocalTime)

			Call result.SetValue("Importance",importance)

			Call result.SetValue("ReminderSet",reminderSet)

			Call result.SetValue("ReminderTime",reminderTime.LSLocalTime)

			Call result.SetValue("Text",text)

			Call result.SetValue("TaskStatus",taskStatus)

			Call result.SetValue("DateCompleted",completedDate.LSLocalTime)

			Call result.SetValue("propPersonalNr",propPersonalNr)

			Call result.SetValue("propId",propId)			

			Call result.SetValue("propErstelltAm",propErstelltAm.LSLocalTime)

			Call result.SetValue("propErstelltVon",propErstelltVon)

			Call result.SetValue("propBearbeitetAm",propBearbeitetAm.LSLocalTime)

			Call result.SetValue("propBearbeitetVon",propBearbeitetVon)

			Call result.SetValue("propDokumentNr",propDokumentNr)

			Call result.SetValue("propDokumentTyp",propDokumentTyp)

			Call result.SetValue("propSystemId",propSystemId)			

			result.UpdateRow

		Else

			Print "ResultSet is Unavailable. Exit!"

			Exit Sub

		End If	

	Else

		Print "Connection failed for DB!"

	End If	

	'##### END INSERT #####

##################################################

When i execute this code, the lotusscript debugger shows an error message in the line ‘result.UpdateRow’: “LS:DO- The operation failed for unspecified reasons.”

  1. Is there something wrong with my code?

  2. Can there be something wrong with DB-permissions, so that the insert fails?

What can i do???

Need some help/tips…

Thanks a lot, Rico.