Skip to Content
0
Former Member
Oct 22, 2012 at 07:09 AM

Not Adding Record

30 Views

Hi

I have written this code , neither it is giving error nor adding record

Dim oRS As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

oRS.DoQuery("SELECT COUNT(*) FROM [@TEMP]")

If oRS.Fields.Item(0).Value = 0 Then

Dim RecSet As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

RecSet.DoQuery("select sex,lastname from OHEM")

While RecSet.EoF = False

'The inner loop runs over all the fields in one record (line) of the table

Dim sSQL As String = String.Format("INSERT INTO [@TEMP] (Code,Name) VALUES ('{0}','{1}')", RecSet.Fields.Item(0).Value, RecSet.Fields.Item(1).Value)

RecSet.MoveNext()

End While

End If

Secondly i want to check if lastname already exists in Temp Table then it should not insert.

Thanks