cancel
Showing results for 
Search instead for 
Did you mean: 

RecordSet

Former Member
0 Kudos

Experts,

How many ways we can use recordset for DOQuery

1. Select Field1 from Table1 (Need to display all value returned in mesageBox)

2. Select Field1, Field2, ..... from Table1 (Need to display all value returned in mesageBox)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try This......


  Dim orecordset As SAPbobsCOM.Recordset
        Dim strarr As String = ""
        orecordset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
        orecordset.DoQuery("select cardcode from ocrd")
        If orecordset.RecordCount > 0 Then
            While orecordset.EoF = False
                If strarr.Length = 0 Then
                    strarr = orecordset.Fields.Item(0).Value
                Else
                    strarr = strarr + "|" + orecordset.Fields.Item(0).Value
                 'strarr = strarr & vbCrLf & orecordset.Fields.Item(0).Value
                  End If
                orecordset.MoveNext()
            End While
            MessageBox.Show(strarr)
        End If

Thanks

Shafi

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

You can follow the above procedure if you want to display the value in single cell i.e. by concatenating the values or if you want them if different cells just assign the recordeset value to that cell with a loop on the recordeset.

Regards